]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - cracklib/cracklib.nm
Merge remote-tracking branch 'stevee/unicode-ucd'
[people/amarx/ipfire-3.x.git] / cracklib / cracklib.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = cracklib
7 version = 2.8.18
8 release = 2
9
10 groups = Security/Password
11 url = http://sourceforge.net/projects/cracklib/
12 license = GPLv2
13 summary = A password-checking library.
14
15 description
16 CrackLib tests passwords to determine whether they match certain \
17 security-oriented characteristics, with the purpose of stopping users \
18 from choosing passwords that are easy to guess. CrackLib performs \
19 several tests on passwords: it tries to generate words from a username \
20 and gecos entry and checks those words against the password; it checks \
21 for simplistic patterns in passwords; and it checks for the password \
22 in a dictionary.
23 end
24
25 source_dl = http://prdownloads.sourceforge.net/cracklib/
26 sources += cracklib-words-20080507.gz
27
28 build
29 requires
30 autoconf
31 automake
32 gettext-devel
33 python-devel
34 end
35
36 dictdir = %{datadir}/cracklib
37 dictpath = %{dictdir}/pw_dict
38
39 configure_options += \
40 --with-default-dict=%{dictpath} \
41 --with-python \
42 --disable-static
43
44 # Only extract the source tarball.
45 prepare
46 cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}.tar.gz
47 cd %{DIR_APP}
48
49 cp lib/packer.h lib/packer.h.in
50 chmod +x util/cracklib-format
51
52 # Apply all patches.
53 %{MACRO_PATCHES}
54
55 #autoreconf -fi
56
57 mkdir cracklib-dicts
58 cp -vf %{DIR_DL}/cracklib-words-20080507.gz cracklib-dicts
59
60 # Create distribution dict.
61 echo -ne "%{DISTRO_NAME}\n%{DISTRO_SNAME}\n" >> \
62 cracklib-dicts/cracklib-distro-words
63 gzip -9 cracklib-dicts/cracklib-distro-words
64 end
65
66 install_cmds
67 # Install python bindings
68 make install DESTDIR=%{BUILDROOT} INSTALL="install -c -p" -C python
69
70 mkdir -pv %{BUILDROOT}{%{dictdir},%{dictpath}}
71 util/cracklib-format cracklib-dicts/* | \
72 util/cracklib-packer %{BUILDROOT}%{dictpath}
73 util/cracklib-format %{BUILDROOT}%{dictdir}/cracklib-small | \
74 util/cracklib-packer %{BUILDROOT}%{dictdir}/cracklib-small
75 rm -f %{BUILDROOT}%{dictdir}/cracklib-small
76
77 sed -e "s@/usr/lib/cracklib_dict@%{dictpath}@g" lib/crack.h \
78 > %{BUILDROOT}%{includedir}/crack.h
79
80 ln -svf cracklib-format %{BUILDROOT}%{sbindir}/mkdict
81 ln -svf cracklib-packer %{BUILDROOT}%{sbindir}/packer
82
83 toprelpath=..
84 touch %{BUILDROOT}/top
85 while ! test -f %{BUILDROOT}%{libdir}/${toprelpath}/top; do
86 toprelpath=../${toprelpath}
87 done
88 rm -f %{BUILDROOT}/top
89
90 if [ "%{dictpath}" != "%{libdir}/cracklib_dict" ]; then
91 ln -svf ${toprelpath}%{dictpath}.hwm %{BUILDROOT}%{libdir}/cracklib_dict.hwm
92 ln -svf ${toprelpath}%{dictpath}.pwd %{BUILDROOT}%{libdir}/cracklib_dict.pwd
93 ln -svf ${toprelpath}%{dictpath}.pwi %{BUILDROOT}%{libdir}/cracklib_dict.pwi
94 fi
95 end
96 end
97
98 packages
99 package %{name}
100 requires = %{name}-dicts
101 end
102
103 package %{name}-devel
104 template DEVEL
105 end
106
107 # We build an extra package with the dictionaries.
108 package %{name}-dicts
109 summary = Dictionaries for %{thisapp}.
110 description = %{summary}
111
112 files
113 %{dictdir}
114 %{dictpath}
115 end
116 end
117
118 # We build an extra python package with the bindings for it.
119 package python-cracklib
120 summary = Python bindings for %{thisapp}.
121 description = %{summary}
122
123 files
124 /usr/lib/python*
125 %{libdir}/python*
126 end
127 end
128
129 package %{name}-debuginfo
130 template DEBUGINFO
131 end
132 end