source: trunk/athena/bin/machtype/debian/rules @ 25436

Revision 25436, 3.4 KB checked in by jdreed, 12 years ago (diff)
In machtype: * Support Ubuntu 12.04.
  • Property svn:executable set to *
Line 
1#!/usr/bin/make -f
2
3DEB_AUTO_UPDATE_AUTOCONF = 2.50
4include /usr/share/cdbs/1/rules/debhelper.mk
5include /usr/share/cdbs/1/class/autotools.mk
6
7ATHENA_MAJOR_VERSION = 10
8ATHENA_MINOR_VERSION = 0
9
10arch_sysnames = $(if $(filter amd64,$(DEB_BUILD_ARCH)),$(1) $(2),$(if $(filter i386,$(DEB_BUILD_ARCH)),$(2),$(error Unrecognized architecture $(DEB_BUILD_ARCH))))
11
12DISTRO := $(shell lsb_release --short --id)
13# Ubuntu releases have Debian versions, but not vice-versa
14DEBIAN_VERSION := $(shell dpkg-query --showformat='$${Version}' --show base-files)
15UBUNTU_VERSION := $(shell lsb_release --short --release)
16
17compare_debian_version = $(shell dpkg --compare-versions $(DEBIAN_VERSION) '>=' $(1) && echo y)
18compare_ubuntu_version = $(shell dpkg --compare-versions $(UBUNTU_VERSION) '>=' $(1) && echo y)
19
20SYS_COMPAT :=
21
22ifneq ($(call compare_debian_version,3.1),y)
23    $(error Debian version $(DEBIAN_VERSION) is too old)
24endif
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
31ifeq ($(DISTRO),Ubuntu)
32    ifeq ($(call compare_ubuntu_version,12.04),y)
33        SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1204,i386_ubuntu1204)
34    endif
35    ifeq ($(call compare_ubuntu_version,11.10),y)
36        SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1110,i386_ubuntu1110)
37    endif
38endif
39
40ifeq ($(call compare_debian_version,6),y)
41    SYS_COMPAT += $(call arch_sysnames,amd64_deb60,i386_deb60)
42endif
43
44ifeq ($(DISTRO),Ubuntu)
45    ifeq ($(call compare_ubuntu_version,11.04),y)
46        SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1104,i386_ubuntu1104)
47    endif
48
49    ifeq ($(call compare_ubuntu_version,10.10),y)
50        SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1010,i386_ubuntu1010)
51    endif
52
53    ifeq ($(call compare_ubuntu_version,10.04),y)
54        SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu1004,i386_ubuntu1004)
55    endif
56
57    ifeq ($(call compare_ubuntu_version,9.10),y)
58        SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu910,i386_ubuntu910)
59    endif
60
61    ifeq ($(call compare_ubuntu_version,9.04),y)
62        SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu904,i386_ubuntu904)
63    endif
64endif
65
66ifeq ($(call compare_debian_version,4.0.4),y)
67    SYS_COMPAT += $(call arch_sysnames,amd64_deb50,i386_deb50)
68endif
69
70ifeq ($(DISTRO),Ubuntu)
71    ifeq ($(call compare_ubuntu_version,8.04),y)
72        SYS_COMPAT += $(call arch_sysnames,amd64_ubuntu804,i386_ubuntu804)
73    endif
74endif
75
76ifeq ($(call compare_debian_version,4),y)
77    SYS_COMPAT += $(call arch_sysnames,amd64_deb40,i386_deb40 i386_rhel4)
78endif
79
80SYS_COMPAT += i386_rhel3 i386_linux24
81
82OPENAFS_VERSION := $(shell dpkg-query --showformat='$${Version}' --show openafs-client)
83MAX_SYSNAMES_PLUS_ONE := $(if $(shell dpkg --compare-versions $(OPENAFS_VERSION) '>=' '1.4.12+dfsg-3~' && echo y),33,17)
84
85ifneq ($(word $(MAX_SYSNAMES_PLUS_ONE),$(SYS_COMPAT)),)
86    $(error Too many sysnames: $(SYSNAME_COMPAT))
87endif
88
89ATHENA_SYS := $(word 1, $(SYS_COMPAT))
90ATHENA_SYS_COMPAT := $(patsubst %:,%,$(subst : ,:,$(patsubst %,%:,$(wordlist 2, $(words $(SYS_COMPAT)), $(SYS_COMPAT)))))
91
92DEB_CONFIGURE_EXTRA_FLAGS += lbindir=/bin \
93        ATHENA_SYS=$(ATHENA_SYS) \
94        ATHENA_SYS_COMPAT=$(ATHENA_SYS_COMPAT) \
95        ATHENA_MAJOR_VERSION=$(ATHENA_MAJOR_VERSION) \
96        ATHENA_MINOR_VERSION=$(ATHENA_MINOR_VERSION)
97
98clean::
99        rm -f configure
Note: See TracBrowser for help on using the repository browser.