summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir@debian.org>2013-09-02 21:27:13 +0300
committerTzafrir Cohen <tzafrir@debian.org>2013-09-02 22:08:28 +0300
commit60b3424917e2d3e7a566f5333ccc5c18dcb21ee2 (patch)
tree00454d37be69ec23be3c05489d6c63e535f0f298
parent20fe66453554f0b6db5becac73ef381c2a341464 (diff)
Separate directories for code and data
-rw-r--r--debian/patches/install_dir52
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules4
3 files changed, 55 insertions, 2 deletions
diff --git a/debian/patches/install_dir b/debian/patches/install_dir
new file mode 100644
index 0000000..42d97f6
--- /dev/null
+++ b/debian/patches/install_dir
@@ -0,0 +1,52 @@
+Author: Tzafrir Cohen <tzafrir@debian.org>
+Description: Separate directories for code and data.
+
+--- a/Makefile
++++ b/Makefile
+@@ -9,6 +9,8 @@ PWD=`pwd`
+ SLEEP_TIME=300
+ EXCLUDE=--exclude=*.tar.gz --exclude=*~ $(EXCLUDE-FILES)
+ ALL_BUT_GZ=$(subst $(wildcard *.tar.gz),,$(wildcard *))
++PYDIR=/usr/lib/python2.7/dist-packages/plinth
++DATADIR=/usr/share/plinth
+
+ ## Catch-all tagets
+ default: config dirs template css docs dbs
+@@ -23,21 +25,17 @@ predepend:
+ install: default
+ mkdir -p $(DESTDIR)/etc/init.d $(DESTDIR)/etc/plinth
+ cp plinth.sample.fhs.config $(DESTDIR)/etc/plinth/plinth.config
+- mkdir -p $(DESTDIR)/usr/lib/python2.7/plinth $(DESTDIR)/usr/bin \
++ mkdir -p $(DESTDIR)$(PYDIR) $(DESTDIR)$(DATADIR) $(DESTDIR)/usr/bin \
+ $(DESTDIR)/usr/share/doc/plinth $(DESTDIR)/usr/share/man/man1
+ rsync -L doc/* $(DESTDIR)/usr/share/doc/plinth/
+ gzip $(DESTDIR)/usr/share/doc/plinth/plinth.1
+ mv $(DESTDIR)/usr/share/doc/plinth/plinth.1.gz $(DESTDIR)/usr/share/man/man1
+- rsync -rl *.py modules templates vendor themes static \
+- --exclude static/doc --exclude ".git/*" --exclude "*.pyc" \
+- $(DESTDIR)/usr/lib/python2.7/plinth
+- mkdir -p $(DESTDIR)/usr/lib/python2.7/plinth/static/doc
+- cp doc/*.html $(DESTDIR)/usr/lib/python2.7/plinth/static/doc
+- rm -f $(DESTDIR)/usr/lib/python2.7/plinth/plinth.config
+- ln -s ../../../../etc/plinth/plinth.config $(DESTDIR)/usr/lib/python2.7/plinth/plinth.config
++ cp -a *.py modules templates $(DESTDIR)$(PYDIR)/
++ cp -a static themes $(DESTDIR)$(DATADIR)/
++ ln -s ../../../../etc/plinth/plinth.config $(DESTDIR)$(PYDIR)/plinth.config
+ cp share/init.d/plinth $(DESTDIR)/etc/init.d
+ rm -f $(DESTDIR)/usr/bin/plinth
+- ln -s ../lib/python2.7/plinth/plinth.py $(DESTDIR)/usr/bin/plinth
++ ln -s ../lib/python2.7/dist-packages/plinth/plinth.py $(DESTDIR)/usr/bin/plinth
+ mkdir -p $(DESTDIR)/var/lib/plinth/cherrypy_sessions $(DESTDIR)/var/log/plinth $(DESTDIR)/var/run
+ cp -r data/* $(DESTDIR)/var/lib/plinth
+ rm -f $(DESTDIR)/var/lib/plinth/users/sqlite3.distrib
+--- a/plinth.sample.fhs.config
++++ b/plinth.sample.fhs.config
+@@ -3,7 +3,7 @@ product_name = Plinth
+ box_name = FreedomBox
+
+ [Path]
+-file_root = /usr/lib/python2.7/plinth
++file_root = /usr/share/plinth/static
+ data_dir = /var/lib/plinth
+ store_file = %(data_dir)s/store.sqlite3
+ user_db = %(data_dir)s/users
diff --git a/debian/patches/series b/debian/patches/series
index ea163ff..74a51fb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
nodendor
debpathes
import_time
+install_dir
diff --git a/debian/rules b/debian/rules
index 27b04c3..0fee33c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,10 +2,10 @@
%:
dh $@ --with python2
-PYDIR=$(CURDIR)/debian/plinth/usr/lib/python2.7/plinth
+DATADIR=$(CURDIR)/debian/plinth/usr/share/plinth
override_dh_auto_install:
dh_auto_install
- find $(PYDIR) -name \*.png -o -name \*.svg | xargs chmod -x
+ find $(DATADIR) -name \*.png -o -name \*.svg | xargs chmod -x
override_dh_installinit:
dh_installinit --onlyscripts