1 | #!/usr/bin/make -f |
---|
2 | |
---|
3 | DEB_AUTO_UPDATE_AUTOCONF = 2.50 |
---|
4 | include /usr/share/cdbs/1/rules/debhelper.mk |
---|
5 | include /usr/share/cdbs/1/class/autotools.mk |
---|
6 | |
---|
7 | ATHENA_MAJOR_VERSION = 10 |
---|
8 | ATHENA_MINOR_VERSION = 0 |
---|
9 | |
---|
10 | arch_sysnames = $(if $(filter amd64,$(DEB_BUILD_ARCH)),$(1) $(2),$(if $(filter i386,$(DEB_BUILD_ARCH)),$(2),$(error Unrecognized architecture $(DEB_BUILD_ARCH)))) |
---|
11 | |
---|
12 | DISTRO := $(shell lsb_release --short --id) |
---|
13 | # Ubuntu releases have Debian versions, but not vice-versa |
---|
14 | DEBIAN_VERSION := $(shell dpkg-query --showformat='$${Version}' --show base-files) |
---|
15 | UBUNTU_VERSION := $(shell lsb_release --short --release) |
---|
16 | |
---|
17 | compare_debian_version = $(shell dpkg --compare-versions $(DEBIAN_VERSION) '>=' $(1) && echo y) |
---|
18 | compare_ubuntu_version = $(shell dpkg --compare-versions $(UBUNTU_VERSION) '>=' $(1) && echo y) |
---|
19 | |
---|
20 | SYS_COMPAT := |
---|
21 | |
---|
22 | ifneq ($(call compare_debian_version,3.1),y) |
---|
23 | $(error Debian version $(DEBIAN_VERSION) is too old) |
---|
24 | endif |
---|
25 | |
---|
26 | # The order of the following code is important, and ensures the correct |
---|
27 | # relative order of Debian and Ubuntu releases. (Note this is not quite |
---|
28 | # chronological order, e.g., Debian 6.0 released before Ubuntu 11.04, |
---|
29 | # but after its DebianImportFreeze.) |
---|
30 | |
---|
31 | ifeq ($(call compare_debian_version,8),y) |
---|
32 | SYS_COMPAT += $(call arch_sysnames,amd64_deb80,i386_deb80) |
---|
33 | endif |
---|
34 | |
---|
35 | # Wheezy has had like 3 freezes, all before raring's DIF, so |
---|
36 | # who knows if this order is right. |
---|
37 | ifeq ($(DISTRO),Ubuntu) |
---|
38 | ifeq ($(call compare_ubuntu_version,13.04),y) |
---|
39 | SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1210,i386_ubuntu1210) |
---|
40 | endif |
---|
41 | endif |
---|
42 | |
---|
43 | ifeq ($(call compare_debian_version,7),y) |
---|
44 | SYS_COMPAT += $(call arch_sysnames,amd64_deb70,i386_deb70) |
---|
45 | endif |
---|
46 | |
---|
47 | ifeq ($(DISTRO),Ubuntu) |
---|
48 | ifeq ($(call compare_ubuntu_version,12.10),y) |
---|
49 | SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1210,i386_ubuntu1210) |
---|
50 | endif |
---|
51 | ifeq ($(call compare_ubuntu_version,12.04),y) |
---|
52 | SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1204,i386_ubuntu1204) |
---|
53 | endif |
---|
54 | ifeq ($(call compare_ubuntu_version,11.10),y) |
---|
55 | SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1110,i386_ubuntu1110) |
---|
56 | endif |
---|
57 | endif |
---|
58 | |
---|
59 | ifeq ($(call compare_debian_version,6),y) |
---|
60 | SYS_COMPAT += $(call arch_sysnames,amd64_deb60,i386_deb60) |
---|
61 | endif |
---|
62 | |
---|
63 | ifeq ($(DISTRO),Ubuntu) |
---|
64 | ifeq ($(call compare_ubuntu_version,11.04),y) |
---|
65 | SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1104,i386_ubuntu1104) |
---|
66 | endif |
---|
67 | |
---|
68 | ifeq ($(call compare_ubuntu_version,10.10),y) |
---|
69 | SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1010,i386_ubuntu1010) |
---|
70 | endif |
---|
71 | |
---|
72 | ifeq ($(call compare_ubuntu_version,10.04),y) |
---|
73 | SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1004,i386_ubuntu1004) |
---|
74 | endif |
---|
75 | |
---|
76 | ifeq ($(call compare_ubuntu_version,9.10),y) |
---|
77 | SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu910,i386_ubuntu910) |
---|
78 | endif |
---|
79 | |
---|
80 | ifeq ($(call compare_ubuntu_version,9.04),y) |
---|
81 | SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu904,i386_ubuntu904) |
---|
82 | endif |
---|
83 | endif |
---|
84 | |
---|
85 | ifeq ($(call compare_debian_version,4.0.4),y) |
---|
86 | SYS_COMPAT += $(call arch_sysnames,amd64_deb50,i386_deb50) |
---|
87 | endif |
---|
88 | |
---|
89 | ifeq ($(DISTRO),Ubuntu) |
---|
90 | ifeq ($(call compare_ubuntu_version,8.04),y) |
---|
91 | SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu804,i386_ubuntu804) |
---|
92 | endif |
---|
93 | endif |
---|
94 | |
---|
95 | ifeq ($(call compare_debian_version,4),y) |
---|
96 | SYS_COMPAT += $(call arch_sysnames,amd64_deb40,i386_deb40 i386_rhel4) |
---|
97 | endif |
---|
98 | |
---|
99 | ifneq ($(call compare_debian_version,7),y) |
---|
100 | SYS_COMPAT += i386_rhel3 i386_linux24 |
---|
101 | endif |
---|
102 | |
---|
103 | OPENAFS_VERSION := $(shell dpkg-query --showformat='$${Version}' --show openafs-client) |
---|
104 | MAX_SYSNAMES_PLUS_ONE := $(if $(shell dpkg --compare-versions $(OPENAFS_VERSION) '>=' '1.4.12+dfsg-3~' && echo y),33,17) |
---|
105 | |
---|
106 | ifneq ($(word $(MAX_SYSNAMES_PLUS_ONE),$(SYS_COMPAT)),) |
---|
107 | $(error Too many sysnames: $(SYSNAME_COMPAT)) |
---|
108 | endif |
---|
109 | |
---|
110 | ATHENA_SYS := $(word 1, $(SYS_COMPAT)) |
---|
111 | ATHENA_SYS_COMPAT := $(patsubst %:,%,$(subst : ,:,$(patsubst %,%:,$(wordlist 2, $(words $(SYS_COMPAT)), $(SYS_COMPAT))))) |
---|
112 | |
---|
113 | DEB_CONFIGURE_EXTRA_FLAGS += lbindir=/bin \ |
---|
114 | ATHENA_SYS=$(ATHENA_SYS) \ |
---|
115 | ATHENA_SYS_COMPAT=$(ATHENA_SYS_COMPAT) \ |
---|
116 | ATHENA_MAJOR_VERSION=$(ATHENA_MAJOR_VERSION) \ |
---|
117 | ATHENA_MINOR_VERSION=$(ATHENA_MINOR_VERSION) |
---|
118 | |
---|
119 | clean:: |
---|
120 | rm -f configure |
---|