| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
export DH_VERBOSE=1 |
|---|
| 10 |
MAJOR=$(shell sed -ne 's/^[^(]*(\([^)]*\)).*/\1/;1p' debian/changelog) |
|---|
| 11 |
REV=$(shell svn up > /dev/null ; env LANG=C svn info --non-interactive | awk '/^Revision:/ { print $$2 }') |
|---|
| 12 |
VERSION="${MAJOR}~svn${REV}" |
|---|
| 13 |
export VERSION |
|---|
| 14 |
|
|---|
| 15 |
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
|---|
| 16 |
CFLAGS += -g |
|---|
| 17 |
endif |
|---|
| 18 |
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
|---|
| 19 |
INSTALL_PROGRAM += -s |
|---|
| 20 |
endif |
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
export DH_OPTIONS |
|---|
| 24 |
|
|---|
| 25 |
build: build-stamp |
|---|
| 26 |
build-stamp: |
|---|
| 27 |
dh_testdir |
|---|
| 28 |
/usr/bin/msgfmt po/fr/LC_MESSAGES/alternc-admintools.po -o po/fr/LC_MESSAGES/alternc-admintools.mo |
|---|
| 29 |
touch build-stamp |
|---|
| 30 |
|
|---|
| 31 |
clean: |
|---|
| 32 |
dh_testdir |
|---|
| 33 |
dh_testroot |
|---|
| 34 |
rm -f build-stamp |
|---|
| 35 |
debconf-updatepo |
|---|
| 36 |
dh_clean |
|---|
| 37 |
|
|---|
| 38 |
install: DH_OPTIONS= |
|---|
| 39 |
install: build |
|---|
| 40 |
dh_testdir |
|---|
| 41 |
dh_testroot |
|---|
| 42 |
dh_clean -k |
|---|
| 43 |
dh_installdirs |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
cp -r etc/* debian/alternc/etc |
|---|
| 47 |
cp -r install/* debian/alternc/usr/share/alternc/install |
|---|
| 48 |
cp -r bureau/* debian/alternc/var/alternc/bureau |
|---|
| 49 |
(cd src && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc) |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
sed -i -e "s/@@REPLACED_DURING_BUILD@@/${MAJOR}/" debian/alternc/var/alternc/bureau/class/local.php |
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
chmod 755 debian/alternc/etc/alternc |
|---|
| 56 |
chmod 644 debian/alternc/etc/alternc/phpmyadmin.inc.php |
|---|
| 57 |
chown -R root:www-data debian/alternc/var/alternc/bureau |
|---|
| 58 |
chmod 1733 debian/alternc/var/alternc/sessions |
|---|
| 59 |
chmod -R 644 debian/alternc/var/alternc/bureau |
|---|
| 60 |
chmod -R a+X debian/alternc/var/alternc/bureau |
|---|
| 61 |
chown -R www-data:www-data debian/alternc/var/alternc/dns debian/alternc/var/alternc/html debian/alternc/var/run/alternc debian/alternc/var/log/alternc debian/alternc/var/alternc/tmp |
|---|
| 62 |
chmod a+x debian/alternc/usr/share/alternc/install/alternc.install debian/alternc/usr/share/alternc/install/dopo.sh debian/alternc/usr/share/alternc/install/mysql.sh debian/alternc/usr/share/alternc/install/newone.php debian/alternc/usr/share/alternc/install/reset_root.php debian/alternc/usr/share/alternc/install/upgrade_check.sh debian/alternc/usr/share/alternc/install/upgrades/*.php debian/alternc/usr/share/alternc/install/upgrades/*.sh |
|---|
| 63 |
|
|---|
| 64 |
for sub in dns dns/redir mail html apacheconf; do \ |
|---|
| 65 |
for i in a b c d e f g h i j k l m n o p q r s t u v w x y z _ 0 1 2 3 4 5 6 7 8 9; do \ |
|---|
| 66 |
mkdir -p debian/alternc/var/alternc/${sub}/${i} ;\ |
|---|
| 67 |
chown www-data debian/alternc/var/alternc/${sub}/${i} ;\ |
|---|
| 68 |
done ;\ |
|---|
| 69 |
done |
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 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 po/fr/LC_MESSAGES/alternc-admintools.mo debian/alternc/usr/share/locale/fr/LC_MESSAGES/ |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
find debian/alternc/var/alternc/bureau/locales/ \ |
|---|
| 81 |
-maxdepth 1 -type f -exec rm -f {} \; |
|---|
| 82 |
|
|---|
| 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/alternc.lintian debian/alternc/usr/share/lintian/overrides/alternc |
|---|
| 86 |
cp debian/alternc-slave.lintian debian/alternc/usr/share/lintian/overrides/alternc-slave |
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
binary-common: build install |
|---|
| 94 |
dh_testdir |
|---|
| 95 |
dh_testroot |
|---|
| 96 |
dh_installchangelogs |
|---|
| 97 |
dh_installdocs |
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
dh_installdebconf |
|---|
| 101 |
dh_installlogrotate |
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
dh_installman man/* |
|---|
| 107 |
dh_installcron |
|---|
| 108 |
|
|---|
| 109 |
dh_install -i --sourcedir=$(CURDIR)/debian/alternc |
|---|
| 110 |
dh_strip |
|---|
| 111 |
dh_link |
|---|
| 112 |
dh_compress |
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
dh_installdeb |
|---|
| 117 |
dh_perl |
|---|
| 118 |
dh_shlibdeps |
|---|
| 119 |
dh_gencontrol -- -cdebian/control |
|---|
| 120 |
dh_md5sums |
|---|
| 121 |
dh_builddeb |
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
binary-indep: build install binary-common |
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
binary-arch: build install binary-common |
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
binary: binary-common |
|---|
| 140 |
|
|---|
| 141 |
.PHONY: build clean binary install |
|---|
| 142 |
|
|---|
| 143 |
build-snapshot: |
|---|
| 144 |
@echo "building a package based on the current snapshot (${VERSION})" |
|---|
| 145 |
svn update || true |
|---|
| 146 |
svn export . ../alternc-${VERSION} |
|---|
| 147 |
cd ../alternc-${VERSION} && sed -i -e '1s/)/~svn${REV})/' debian/changelog && debuild |
|---|