]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - pkgs/nss-softokn/nss-softokn.nm
Remove legacy build system.
[people/ms/ipfire-3.x.git] / pkgs / nss-softokn / nss-softokn.nm
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include $(PKGROOT)/Include
26
27 PKG_NAME = nss-softokn
28 PKG_VER = 3.12.8
29 PKG_REL = 0
30
31 PKG_MAINTAINER =
32 PKG_GROUP = System/Libraries
33 PKG_URL = http://www.mozilla.org/projects/security/pki/nss/
34 PKG_LICENSE = MPLv1.1 or GPLv2+ or LGPLv2+
35 PKG_SUMMARY = Network Security Services Softoken Module.
36
37 PKG_BUILD_DEPS+= nspr-devel nss-util-devel perl pkg-config psmisc sqlite-devel \
38 zlib-devel
39
40 define PKG_DESCRIPTION
41 Network Security Services Softoken Cryptographic Module.
42 endef
43
44 PKG_TARBALL = $(THISAPP)-stripped.tar.bz2
45
46 PKG_PACKAGES += $(PKG_NAME_REAL)-devel
47
48 PKG_DEPS-$(PKG_NAME_REAL)-devel += nss-util-devel
49
50 # Mozilla does no versioning :(
51 define PKG_FILES-$(PKG_NAME_REAL)-devel
52 /usr/bin/*-config
53 /usr/include
54 /usr/lib/libfreebl3.so
55 /usr/lib/pkgconfig
56 endef
57
58 ## Define some global environment variables
59
60 export FREEBL_NO_DEPEND=1
61 export FREEBL_USE_PRELINK=1
62
63 # Enable compiler optimizations and disable debugging code
64 export BUILD_OPT=1
65 export XCFLAGS=$(CFLAGS)
66
67 export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
68 export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
69
70 export NSPR_INCLUDE_DIR=/usr/include/nspr4
71 export NSPR_LIB_DIR=/usr/lib
72
73 export NSS_INCLUDE_DIR=/usr/include/nss3
74 export NSS_LIB_DIR=/usr/lib
75
76 export NSS_USE_SYSTEM_SQLITE=1
77
78 define STAGE_BUILD
79 cd $(DIR_APP) && make -C ./mozilla/security/coreconf
80 cd $(DIR_APP) && make -C ./mozilla/security/dbm
81 cd $(DIR_APP) && make -C ./mozilla/security/nss
82 endef
83
84 define STAGE_INSTALL
85 -mkdir -pv $(BUILDROOT)/lib
86 -mkdir -pv $(BUILDROOT)/usr/include/nss3
87 -mkdir -pv $(BUILDROOT)/usr/{bin,lib}
88 -mkdir -pv $(BUILDROOT)/usr/lib/pkgconfig
89 -mkdir -pv $(BUILDROOT)/usr/lib/nss/unsupported-tools
90
91 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/lib/libsoftokn3.so \
92 $(BUILDROOT)/usr/lib
93 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/lib/libnssdbm3.so \
94 $(BUILDROOT)/usr/lib
95 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/lib/libfreebl3.so \
96 $(BUILDROOT)/lib
97 ln -svf ../../lib/libfreebl3.so $(BUILDROOT)/usr/lib/libfreebl3.so
98
99 # Copy the binaries we ship as unsupported
100 install -p -v -m 755 $(DIR_APP)/mozilla/dist/*.OBJ/bin/shlibsign $(BUILDROOT)/usr/lib/nss/unsupported-tools
101
102 sed -e "s,@libdir@,/usr/lib,g" \
103 -e "s,@prefix@,/usr,g" \
104 -e "s,@exec_prefix@,/usr,g" \
105 -e "s,@includedir@,/usr/include/nss3,g" \
106 -e "s,@MOD_MAJOR_VERSION@,$$(grep "#define.*SOFTOKEN_VMAJOR" $(DIR_APP)/mozilla/security/nss/lib/softoken/softkver.h | awk '{print $3}'),g" \
107 -e "s,@MOD_MINOR_VERSION@,$$(grep "#define.*SOFTOKEN_VMINOR" $(DIR_APP)/mozilla/security/nss/lib/softoken/softkver.h | awk '{print $3}'),g" \
108 -e "s,@MOD_PATCH_VERSION@,$$(grep "#define.*SOFTOKEN_VPATCH" $(DIR_APP)/mozilla/security/nss/lib/softoken/softkver.h | awk '{print $3}'),g" \
109 < $(DIR_SOURCE)/nss-softokn-config.in \
110 > $(BUILDROOT)/usr/bin/nss-softokn-config
111 chmod -v 755 $(BUILDROOT)/usr/bin/nss-softokn-config
112
113 # XXX need to fix this
114 sed \
115 -e "s,%libdir%,/usr/lib,g" \
116 -e "s,%prefix%,/usr,g" \
117 -e "s,%exec_prefix%,/usr,g" \
118 -e "s,%includedir%,/usr/include/nss3,g" \
119 -e "s,%NSS_VERSION%,$(PKG_VER),g" \
120 -e "s,%NSPR_VERSION%,$$(nspr-config --version),g" \
121 -e "s,%NSSUTIL_VERSION%,$$(nss-util-config --version),g" \
122 -e "s,%SOFTOKEN_VERSION%,$(PKG_VER),g" \
123 < $(DIR_SOURCE)/nss-softokn.pc.in \
124 > $(BUILDROOT)/usr/lib/pkgconfig/nss-softokn.pc
125
126 # Copy the include files we want
127 cp -vf $(DIR_APP)/mozilla/dist/public/nss/*.h $(BUILDROOT)/usr/include/nss3
128 cp -vf $(DIR_APP)/mozilla/dist/private/nss/blapi.h \
129 $(BUILDROOT)/usr/include/nss3
130 chmod -v 644 $(BUILDROOT)/usr/include/nss3/*.h
131 endef