Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
4
5 # ctn code base is large and ancient (including compatibility code for
6 # supporting compilers of the pre-C89 era). Patching to accomodate for
7 # contemporary compiler behavior results in unreasonably large changes,
8 # so we favor dropping the checks for dangerous behaviors. For more
9 # information, refer to #1074893.
10 export DEB_CFLAGS_MAINT_APPEND = \
11 -Wno-error=incompatible-pointer-types \
12 -Wno-error=implicit-int \
13 -Wno-error=int-conversion \
14 -std=gnu99
15
16 pkg-ctn := ctn
17 pkg-ctn-dev := ctn-dev
18
19 %:
20 dh $@
21
22 # we must provide *SIZE inside dicom.h or otherwise applications which
23 # would use ctn might be doomed to get improper U32 types etc
24 # that file will be included in dicom.h - hard patched
25 debian/savefiles:
26 mkdir -p debian/savefiles
27 mkdir -p debian/savefiles/apps/dcm_modify_object
28 cp -a apps/dcm_modify_object/gram.h debian/savefiles/apps/dcm_modify_object
29
30 debian/test-sizes: debian/savefiles
31 cc debian/test-sizes.c -o debian/test-sizes
32
33 debian/intsizes.h: debian/test-sizes
34 sh debian/intsizes_h.sh
35
36 override_dh_auto_build: debian/intsizes.h
37 debian/test-sizes >| debian/ctnmake.debian.mysql.options.full
38 echo "CFLAGS=$(CFLAGS)" >> debian/ctnmake.debian.mysql.options.full
39 echo "LDFLAGS=$(LDFLAGS)" >> debian/ctnmake.debian.mysql.options.full
40 cat debian/ctnmake.debian.mysql.options >> debian/ctnmake.debian.mysql.options.full
41 mv debian/intsizes.h facilities/dicom/
42 chmod +x $(CURDIR)/apps/scripts/createdirectory
43 chmod +x $(CURDIR)/apps/scripts/checkEnvironment
44 mkdir $(CURDIR)/lib
45 mkdir $(CURDIR)/include
46
47 (. debian/debian.mysql.options.env; make install)
48
49 override_dh_auto_clean:
50 dh_auto_clean
51 # restore changed files
52 if [ -d debian/savefiles ] ; then \
53 mv debian/savefiles/apps/dcm_modify_object/gram.h apps/dcm_modify_object ; \
54 rm -rf debian/savefiles/apps ; \
55 fi
56 rm -rf debian/savefiles
57 rm -f debian/ctn*.postinst.* debian/ctn*.prerm.* debian/intsizes.h
58 rm -f debian/ctnmake.debian.mysql.options.full debian/test-sizes
59 rm -f facilities/dicom/intsizes.h
60 rm -f libsrc/*.c libsrc/*.h
61 rm -f `find . -name \*.o -or -name \*.a`
62 rm -rf include
63 rm -rf lib
64
65 override_dh_prep:
66 # ctn build process does build+install in one rush
67 # dear dh_prep, please leave my debian/tmp
68 mv $(CURDIR)/debian/tmp $(CURDIR)/debian/do_not_delete_this_tmp_dir
69 dh_prep
70 mv $(CURDIR)/debian/do_not_delete_this_tmp_dir $(CURDIR)/debian/tmp
71
72 override_dh_auto_install:
73 echo 'Do not try to call `make install` since it requires setting variable DICOM_MAKE'
74
75 override_dh_fixperms:
76 dh_fixperms
77 chmod +x `echo $(CURDIR)/debian/$(pkg-ctn)/usr/share/ctn/mysql/*`
78 chmod -x `echo $(CURDIR)/debian/$(pkg-ctn)/usr/share/ctn/mysql/*.script`