Fix archipelago modules virtual package
[archipelago] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 #export DH_VERBOSE=1
5
6 .PHONY: override_dh_dkms override_dh_strip override_dh_installinit \
7         override_dh_auto_build override_dh_fixperms
8 export VERSION := $(shell head -n 1 debian/changelog | sed -r 's/.*([0-9]+\.[0-9]+.*)-[0-9]+.*/\1/g')
9 ifeq ($(RAW_VERSION),)
10 export RAW_VERSION := $(shell cat $(CURDIR)/version)
11 endif
12
13 %:
14         if [ -d $(CURDIR)/debian ] && [ ! -e $(CURDIR)/debian/control ] && \
15                 [ -e $(CURDIR)/debian/control.in ] ; then \
16                 cat $(CURDIR)/debian/control.in | sed "s/#VERSION#/$(RAW_VERSION)/g" \
17                         > $(CURDIR)/debian/control ; git add $(CURDIR)/debian/control ;\
18         fi
19         dh $@ --with dkms --with python2
20
21 override_dh_dkms:
22         dh_dkms -V $(VERSION)
23
24 override_dh_strip:
25         dh_strip -plibxseg0 --dbg-package=libxseg0-dbg
26         dh_strip -parchipelago --dbg-package=archipelago-dbg
27
28 override_dh_installinit:
29         dh_installinit --no-start
30
31 override_dh_auto_build:
32         dh_auto_build -- build
33
34 override_dh_fixperms:
35         dh_fixperms --exclude var/log/ganeti/extstorage
36 #       chmod 0750 $(DESTDIR)/var/log/ganeti/extstorage
37
38 override_dh_install:
39         cat $(CURDIR)/debian/archipelago-modules-dkms.install.in | sed "s/#VERSION#/$(VERSION)/g" \
40                 > $(CURDIR)/debian/archipelago-modules-dkms.install
41         dh_install
42         (cd debian/archipelago-modules-source/usr/src \
43                 && chown -R root:root modules \
44                 && tar -c modules | bzip2 > archipelago-modules.tar.bz2 \
45                 && rm -rf modules)
46