]>
Commit | Line | Data |
---|---|---|
bfbb4b80 | 1 | ############################################################################### |
802ea3af MT |
2 | # IPFire.org - An Open Source Firewall Solution # |
3 | # Copyright (C) - IPFire Development Team <info@ipfire.org> # | |
bfbb4b80 MT |
4 | ############################################################################### |
5 | ||
802ea3af | 6 | name = cracklib |
00d1e562 | 7 | version = 2.9.5 |
a3845e50 | 8 | release = 2 |
bfbb4b80 | 9 | |
802ea3af MT |
10 | groups = Security/Password |
11 | url = http://sourceforge.net/projects/cracklib/ | |
12 | license = GPLv2 | |
13 | summary = A password-checking library. | |
bfbb4b80 | 14 | |
802ea3af | 15 | description |
bfbb4b80 MT |
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. | |
802ea3af MT |
23 | end |
24 | ||
71e6a8ef | 25 | source_dl = http://prdownloads.sourceforge.net/cracklib/ |
802ea3af | 26 | sources += cracklib-words-20080507.gz |
bfbb4b80 | 27 | |
802ea3af MT |
28 | build |
29 | requires | |
30 | python-devel | |
31 | end | |
bfbb4b80 | 32 | |
71e6a8ef MT |
33 | dictdir = %{datadir}/cracklib |
34 | dictpath = %{dictdir}/pw_dict | |
35 | ||
a3845e50 MT |
36 | export LD_LIBRARY_PATH = %{DIR_APP}/lib/.libs |
37 | ||
802ea3af | 38 | configure_options += \ |
316bfb6e | 39 | --with-default-dict=%{dictpath} \ |
802ea3af MT |
40 | --with-python \ |
41 | --disable-static | |
6ecc8c00 | 42 | |
802ea3af MT |
43 | # Only extract the source tarball. |
44 | prepare | |
45 | cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}.tar.gz | |
71e6a8ef MT |
46 | cd %{DIR_APP} |
47 | ||
48 | cp lib/packer.h lib/packer.h.in | |
49 | chmod +x util/cracklib-format | |
6ecc8c00 | 50 | |
71e6a8ef MT |
51 | mkdir cracklib-dicts |
52 | cp -vf %{DIR_DL}/cracklib-words-20080507.gz cracklib-dicts | |
53 | ||
54 | # Create distribution dict. | |
55 | echo -ne "%{DISTRO_NAME}\n%{DISTRO_SNAME}\n" >> \ | |
56 | cracklib-dicts/cracklib-distro-words | |
57 | gzip -9 cracklib-dicts/cracklib-distro-words | |
802ea3af | 58 | end |
6ecc8c00 | 59 | |
802ea3af | 60 | install_cmds |
71e6a8ef MT |
61 | # Install python bindings |
62 | make install DESTDIR=%{BUILDROOT} INSTALL="install -c -p" -C python | |
63 | ||
71e6a8ef MT |
64 | mkdir -pv %{BUILDROOT}{%{dictdir},%{dictpath}} |
65 | util/cracklib-format cracklib-dicts/* | \ | |
66 | util/cracklib-packer %{BUILDROOT}%{dictpath} | |
67 | util/cracklib-format %{BUILDROOT}%{dictdir}/cracklib-small | \ | |
68 | util/cracklib-packer %{BUILDROOT}%{dictdir}/cracklib-small | |
69 | rm -f %{BUILDROOT}%{dictdir}/cracklib-small | |
70 | ||
71 | sed -e "s@/usr/lib/cracklib_dict@%{dictpath}@g" lib/crack.h \ | |
72 | > %{BUILDROOT}%{includedir}/crack.h | |
73 | ||
74 | ln -svf cracklib-format %{BUILDROOT}%{sbindir}/mkdict | |
75 | ln -svf cracklib-packer %{BUILDROOT}%{sbindir}/packer | |
76 | ||
77 | toprelpath=.. | |
78 | touch %{BUILDROOT}/top | |
79 | while ! test -f %{BUILDROOT}%{libdir}/${toprelpath}/top; do | |
80 | toprelpath=../${toprelpath} | |
81 | done | |
82 | rm -f %{BUILDROOT}/top | |
83 | ||
84 | if [ "%{dictpath}" != "%{libdir}/cracklib_dict" ]; then | |
85 | ln -svf ${toprelpath}%{dictpath}.hwm %{BUILDROOT}%{libdir}/cracklib_dict.hwm | |
86 | ln -svf ${toprelpath}%{dictpath}.pwd %{BUILDROOT}%{libdir}/cracklib_dict.pwd | |
87 | ln -svf ${toprelpath}%{dictpath}.pwi %{BUILDROOT}%{libdir}/cracklib_dict.pwi | |
88 | fi | |
802ea3af MT |
89 | end |
90 | end | |
bfbb4b80 | 91 | |
802ea3af MT |
92 | packages |
93 | package %{name} | |
94 | requires = %{name}-dicts | |
95 | end | |
1f9bc2f0 | 96 | |
802ea3af MT |
97 | package %{name}-devel |
98 | template DEVEL | |
99 | end | |
1f9bc2f0 | 100 | |
802ea3af MT |
101 | # We build an extra package with the dictionaries. |
102 | package %{name}-dicts | |
103 | summary = Dictionaries for %{thisapp}. | |
104 | description = %{summary} | |
1f9bc2f0 | 105 | |
802ea3af | 106 | files |
71e6a8ef MT |
107 | %{dictdir} |
108 | %{dictpath} | |
802ea3af MT |
109 | end |
110 | end | |
1f9bc2f0 | 111 | |
802ea3af MT |
112 | # We build an extra python package with the bindings for it. |
113 | package python-cracklib | |
316bfb6e | 114 | summary = Python bindings for %{thisapp}. |
802ea3af | 115 | description = %{summary} |
1f9bc2f0 | 116 | |
316bfb6e MT |
117 | files |
118 | /usr/lib/python* | |
119 | %{libdir}/python* | |
120 | end | |
802ea3af | 121 | end |
1f9bc2f0 MT |
122 | |
123 | package %{name}-debuginfo | |
124 | template DEBUGINFO | |
125 | end | |
802ea3af | 126 | end |