~ubuntu-branches/ubuntu/vivid/checkpolicy/vivid

« back to all changes in this revision

Viewing changes to debian/common/pkgvars.mk

  • Committer: Package Import Robot
  • Author(s): Laurent Bigonville
  • Date: 2012-03-27 20:22:24 UTC
  • Revision ID: package-import@ubuntu.com-20120327202224-wcmz9qko6u35sqkd
Tags: 2.1.8-2
* Team upload.
* Switch to debhelper sequence
* debian/control:
  - Bump Standards-Version to 3.9.3
  - Add Homepage field
  - Update Vcs-* fields
  - Make checkpolicy arch linux-any
  - Put under the Debian SELinux team maintenance
* Add debian/gbp.conf file
* debian/rules: Append CPPFLAGS hardening flags to CFLAGS as build system is
  not using CPPFLAGS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
############################ -*- Mode: Makefile -*- ###########################
2
 
## pkgvars.mk --- 
3
 
## Author           : Manoj Srivastava ( srivasta@glaurung.green-gryphon.com ) 
4
 
## Created On       : Sat Nov 15 02:56:30 2003
5
 
## Created On Node  : glaurung.green-gryphon.com
6
 
## Last Modified By : Manoj Srivastava
7
 
## Last Modified On : Thu Jun 15 12:05:46 2006
8
 
## Last Machine Used: glaurung.internal.golden-gryphon.com
9
 
## Update Count     : 11
10
 
## Status           : Unknown, Use with caution!
11
 
## HISTORY          : 
12
 
## Description      : This is what allows us toseparate out the top level
13
 
##                    targets, by determining which packages needto be built.
14
 
## 
15
 
## arch-tag: 75fcc720-7389-4eaa-a7ac-c556d3eac331
16
 
## 
17
 
## 
18
 
## This program is free software; you can redistribute it and/or modify
19
 
## it under the terms of the GNU General Public License as published by
20
 
## the Free Software Foundation; either version 2 of the License, or
21
 
## (at your option) any later version.
22
 
##
23
 
## This program is distributed in the hope that it will be useful,
24
 
## but WITHOUT ANY WARRANTY; without even the implied warranty of
25
 
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
 
## GNU General Public License for more details.
27
 
##
28
 
## You should have received a copy of the GNU General Public License
29
 
## along with this program; if not, write to the Free Software
30
 
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
31
 
##
32
 
###############################################################################
33
 
 
34
 
# The maintainer information.
35
 
maintainer := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Maintainer: | \
36
 
                sed 's/^Maintainer: *//')
37
 
email := srivasta@debian.org
38
 
 
39
 
# Priority of this version (or urgency, as dchanges would call it)
40
 
urgency := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Urgency: | \
41
 
             sed 's/^Urgency: *//')
42
 
 
43
 
# Common useful variables
44
 
DEB_SOURCE_PACKAGE := $(strip $(shell egrep '^Source: ' debian/control      |       \
45
 
                                      cut -f 2 -d ':'))
46
 
DEB_VERSION        := $(strip $(shell LC_ALL=C dpkg-parsechangelog          |       \
47
 
                                      egrep '^Version:' | cut -f 2 -d ' '))
48
 
DEB_ISNATIVE       := $(strip $(shell LC_ALL=C dpkg-parsechangelog          |       \
49
 
                       perl -ne 'print if (m/^Version:/g && ! m/^Version:.*\-/);'))
50
 
DEB_DISTRIBUTION  := $(strip $(shell LC_ALL=C dpkg-parsechangelog          |        \
51
 
                                      egrep '^Distribution:' | cut -f 2 -d ' '))
52
 
 
53
 
DEB_PACKAGES := $(shell perl -e '                                                    \
54
 
                  $$/="";                                                            \
55
 
                  while(<>){                                                         \
56
 
                     $$p=$$1 if m/^Package:\s*(\S+)/;                                \
57
 
                     die "duplicate package $$p" if $$seen{$$p};                     \
58
 
                     $$seen{$$p}++; print "$$p " if $$p;                             \
59
 
                  }' debian/control )
60
 
 
61
 
DEB_INDEP_PACKAGES := $(shell perl -e '                                              \
62
 
                         $$/="";                                                     \
63
 
                         while(<>){                                                  \
64
 
                            $$p=$$1 if m/^Package:\s*(\S+)/;                         \
65
 
                            die "duplicate package $$p" if $$seen{$$p};              \
66
 
                            $$seen{$$p}++;                                           \
67
 
                            $$a=$$1 if m/^Architecture:\s*(\S+)/m;                   \
68
 
                            next unless ($$a eq "all");                              \
69
 
                            print "$$p " if $$p;                                     \
70
 
                         }' debian/control )
71
 
 
72
 
DEB_ARCH_PACKAGES := $(shell perl -e '                                               \
73
 
                         $$/="";                                                     \
74
 
                         while(<>){                                                  \
75
 
                            $$p=$$1 if m/^Package:\s*(\S+)/;                         \
76
 
                            die "duplicate package $$p" if $$seen{$$p};              \
77
 
                            $$seen{$$p}++;                                           \
78
 
                            $$c="";                                                  \
79
 
                            if (/^Architecture:\s*(.*?)\s*$$/sm) {                   \
80
 
                              @a = split /\s+/, $$1 };                               \
81
 
                              for my $$b (@a) {                                      \
82
 
                                next unless ($$b eq "$(DEB_HOST_ARCH)" ||            \
83
 
                                             $$b eq "any");                          \
84
 
                                $$c="$$p";                                           \
85
 
                            }                                                        \
86
 
                            print "$$c " if $$c;                                     \
87
 
                         }' debian/control )
88
 
 
89
 
# This package is what we get after removing the psuedo dirs we use in rules
90
 
package   = $(notdir $@)
91
 
DEBIANDIR = $(dir $(firstword $(MAKEFILE_LIST)))
92
 
 
93
 
ifeq  (,$(filter parallel=%,$(FAILS_PARALLEL_BUILD)))
94
 
  ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
95
 
    NUMJOBS = $(patsubst parallel=%,-j%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
96
 
  endif
97
 
endif
98
 
 
99
 
# Define canned sequences used to strip executables and libraries,
100
 
# keeping in mind the directives in DEB_BUILD_OPTIONS
101
 
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
102
 
define strip-exec
103
 
find $(TMPTOP) -type f | while read i; do                                    \
104
 
   if file -b $$i | egrep -q "^ELF.*executable"; then                        \
105
 
     strip --strip-all --remove-section=.comment --remove-section=.note $$i; \
106
 
   fi;                                                                       \
107
 
 done
108
 
endef
109
 
 
110
 
define strip-lib
111
 
find $(TMPTOP) -type f | while read i; do                                         \
112
 
   if file -b $$i | egrep -q "^ELF.*shared object"; then                          \
113
 
     strip --strip-unneeded --remove-section=.comment --remove-section=.note $$i; \
114
 
   fi;                                                                            \
115
 
done
116
 
endef
117
 
else
118
 
define strip-exec
119
 
@echo Not strippping executables as asked
120
 
endef
121
 
 
122
 
define strip-lib
123
 
@echo Not strippping libraries as asked
124
 
endef
125
 
 
126
 
endif
127
 
 
128
 
# this canned command specifies how to run dpkg-shlibs to add things
129
 
# to debian/substvars by scanning executables and libraries; this
130
 
# should suffice for the common case. Some rules files might need some
131
 
# changes to the command sequence, though
132
 
define get-shlib-deps
133
 
k=`find $(TMPTOP) -type f | ( while read i; do          \
134
 
    if file -b $$i |                                    \
135
 
      egrep -q "^ELF.*(executable.*dynamically linked|shared object)"; then   \
136
 
        j="$$j $$i";                                     \
137
 
    fi;                                                  \
138
 
done; echo $$j; )`; if [ -n "$$k" ]; then dpkg-shlibdeps $$k; fi
139
 
endef
140
 
 
141
 
# This canned sequence checks to see if all the libraries we link to
142
 
# actually provide some symbols needed by some executable ot library
143
 
# in the package itself.
144
 
ifeq (,$(strip $(filter nocheck,$(DEB_BUILD_OPTIONS))))
145
 
  ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
146
 
define check-libraries
147
 
echo Checking libs
148
 
xtra=$$($(SHELL) debian/common/checklibs); \
149
 
if [ -n "$$extra" ]; then                  \
150
 
  echo "Extra libraries: $$extra";         \
151
 
  exit 1;                                  \
152
 
fi
153
 
endef
154
 
  else
155
 
define check-libraries
156
 
echo Not checking libs
157
 
endef
158
 
  endif
159
 
else
160
 
define check-libraries
161
 
echo Not checking libs
162
 
endef
163
 
endif
164
 
 
165
 
 
166
 
#Local variables:
167
 
#mode: makefile
168
 
#End: