source: trunk/debian/rules @ 1012

Revision 1012, 4.5 KB checked in by anarcat, 7 years ago (diff)

bring back the version in the left menu. we do it on build as before,
editing local.php, but not exactly as before as local.php is now
dynamic. we therefore rely of it containing a special string which
we replace in debian/rules. admins can disable the version display by
setting it to empty in /etc/alternc/local.sh

Closes: #637

  • Property svn:executable set to *
Line 
1#!/usr/bin/make -f
2# Sample debian/rules that uses debhelper.
3# This file is public domain software, originally written by Joey Hess.
4#
5# This version is for a multibinary package. It also allows you to build any
6# of the binary packages independantly, via binary-<package> targets.
7
8# Uncomment this to turn on verbose mode.
9export DH_VERBOSE=1
10export VERSION=`head -1 debian/changelog | sed -e 's/^[^(]*(\([^)]*\)).*/\1/'`
11
12ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
13        CFLAGS += -g
14endif
15ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
16        INSTALL_PROGRAM += -s
17endif
18
19# This has to be exported to make some magic below work.
20export DH_OPTIONS
21
22build: build-stamp
23build-stamp:
24        dh_testdir
25        (cd src && $(MAKE))
26        /usr/bin/msgfmt po/alternc-admintools.fr.po -o alternc-admintools.mo
27        touch build-stamp
28
29clean:
30        dh_testdir
31        dh_testroot
32        rm -f build-stamp
33        (cd src/ && $(MAKE) clean)
34        dh_clean
35
36install: DH_OPTIONS=
37install: build
38        dh_testdir
39        dh_testroot
40        dh_clean -k
41        dh_installdirs
42
43        # Install
44        cp -r etc/* debian/alternc/etc
45        cp -r install/* debian/alternc/usr/share/alternc/install
46        cp -r bureau/* debian/alternc/var/alternc/bureau
47        (cd src && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc)
48
49        VERSION=`sed -ne 's/^[^(]*(\([^)]*\)).*/\1/;1p' debian/changelog`
50        sed -i -e "s/@@REPLACED_DURING_BUILD@@/${VERSION}/" debian/alternc/var/alternc/bureau/class/local.php
51
52        # Fix permisions
53        chmod 755 debian/alternc/etc/alternc
54        chmod 644 debian/alternc/etc/alternc/phpmyadmin.inc.php
55        chown -R root:www-data debian/alternc/var/alternc/bureau
56        chmod -R 644 debian/alternc/var/alternc/bureau
57        chmod -R a+X debian/alternc/var/alternc/bureau
58        chown -R www-data:www-data debian/alternc/var/alternc/dns
59        chown -R www-data:www-data debian/alternc/var/alternc/html
60        chown -R www-data:www-data debian/alternc/var/run/alternc
61        chown -R www-data:www-data debian/alternc/var/log/alternc
62
63        chmod a+x debian/alternc/usr/share/alternc/install/alternc.install
64        chmod a+x debian/alternc/usr/share/alternc/install/dopo.sh
65        chmod a+x debian/alternc/usr/share/alternc/install/mysql.sh
66        chmod a+x debian/alternc/usr/share/alternc/install/newone.php
67        chmod a+x debian/alternc/usr/share/alternc/install/reset_root.php
68        chmod a+x debian/alternc/usr/share/alternc/install/upgrade_check.sh
69        chmod a+x debian/alternc/usr/share/alternc/install/upgrades/*.php
70        chmod a+x debian/alternc/usr/share/alternc/install/upgrades/*.sh
71        # Ex old alternc-admintools
72        install tools/top_http_users debian/alternc/usr/bin
73        install tools/top_mysql_users debian/alternc/usr/bin
74        install tools/top_ftp_users debian/alternc/usr/bin
75        install tools/get_domains_by_account debian/alternc/usr/bin
76        install tools/get_account_by_domain debian/alternc/usr/bin
77        install -m 644 alternc-admintools.mo debian/alternc/usr/share/locale/fr/LC_MESSAGES
78
79        # Remove helpers files from l18n dir
80        find debian/alternc/var/alternc/bureau/locales/ \
81                -maxdepth 1 -type f -exec rm -f {} \;
82        # Remove CVS directories
83        /usr/bin/find debian/alternc -depth -type d -name CVS -exec rm {} -rf \;
84        /usr/bin/find debian/alternc -depth -type d -name .svn -exec rm {} -rf \;
85        cp debian/lintian-override \
86                debian/alternc/usr/share/lintian/overrides/alternc
87
88# This single target is used to build all the packages, all at once, or
89# one at a time. So keep in mind: any options passed to commands here will
90# affect _all_ packages. Anything you want to only affect one package
91# should be put in another target, such as the install target.
92
93binary-common: build install
94        dh_testdir
95        dh_testroot
96        dh_installchangelogs
97        dh_installdocs
98#       dh_installexamples
99#       dh_installmenu
100        dh_installdebconf
101        dh_installlogrotate
102#       dh_installemacsen
103#       dh_installpam
104#       dh_installmime
105#       dh_installinit
106        dh_installman man/*
107        dh_installcron
108#       dh_installinfo
109        dh_strip
110        dh_link
111        dh_compress
112#we handle our own perms
113#       dh_fixperms
114#       dh_makeshlibs
115        dh_installdeb
116        dh_perl
117        dh_shlibdeps
118        dh_gencontrol -- -cdebian/control
119        dh_md5sums
120        dh_builddeb
121
122# Build architecture independant packages using the common target.
123binary-indep: build install binary-common
124# (Uncomment this next line if you have such packages.)
125#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
126
127# Build architecture dependant packages using the common target.
128binary-arch: build install binary-common
129#       $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
130
131# Any other binary targets build just one binary package at a time.
132# binary-%: build install
133#       make -f debian/rules binary-common DH_OPTIONS=-p$*
134
135# binary: binary-indep binary-arch
136# .PHONY: build clean binary-indep binary-arch binary install
137
138binary: binary-common
139
140.PHONY: build clean binary install
Note: See TracBrowser for help on using the repository browser.