cracklib/cracklib.spec

Tue, 28 Aug 2012 18:34:50 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:34:50 +0200
changeset 572
97e49dc59b23
child 573
37c544fc0159
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

michael@572 1 ##
michael@572 2 ## cracklib.spec -- OpenPKG RPM Package Specification
michael@572 3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@572 4 ##
michael@572 5 ## Permission to use, copy, modify, and distribute this software for
michael@572 6 ## any purpose with or without fee is hereby granted, provided that
michael@572 7 ## the above copyright notice and this permission notice appear in all
michael@572 8 ## copies.
michael@572 9 ##
michael@572 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@572 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@572 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@572 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@572 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@572 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@572 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@572 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@572 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@572 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@572 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@572 21 ## SUCH DAMAGE.
michael@572 22 ##
michael@572 23
michael@572 24 # package information
michael@572 25 Name: cracklib
michael@572 26 Summary: Filter Guessable Passwords
michael@572 27 URL: http://cracklib.sourceforge.net/
michael@572 28 Vendor: Alec Muffett et al.
michael@572 29 Packager: OpenPKG Foundation e.V.
michael@572 30 Distribution: OpenPKG Community
michael@572 31 Class: PLUS
michael@572 32 Group: Security
michael@572 33 License: Artistic
michael@572 34 Version: 2.8.19
michael@572 35 Release: 20120519
michael@572 36
michael@572 37 # list of sources
michael@572 38 Source0: http://switch.dl.sourceforge.net/cracklib/cracklib-%{version}.tar.gz
michael@572 39 Source1: http://switch.dl.sourceforge.net/cracklib/cracklib-words.gz
michael@572 40 Source2: ftp://ftp.cerias.purdue.edu/pub/dict/wordlists/computer/common-passwords.txt.gz
michael@572 41 Source3: ftp://ftp.cerias.purdue.edu/pub/dict/wordlists/computer/Jargon.gz
michael@572 42 Source4: http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/share/dict/web2
michael@572 43 Source5: http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/share/dict/web2a
michael@572 44 Source6: http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/share/dict/propernames
michael@572 45 Source7: Makefile
michael@572 46
michael@572 47 # build information
michael@572 48 BuildPreReq: OpenPKG, openpkg >= 20100101, make
michael@572 49 PreReq: OpenPKG, openpkg >= 20100101, make
michael@572 50
michael@572 51 %description
michael@572 52 CrackLib is a library which may be used in a "passwd"-like program.
michael@572 53 The idea is simple: try to prevent users from choosing passwords
michael@572 54 that could be guessed by "Crack" by filtering them out, at source.
michael@572 55
michael@572 56 %track
michael@572 57 prog cracklib = {
michael@572 58 version = %{version}
michael@572 59 url = http://sourceforge.net/projects/cracklib/files/
michael@572 60 regex = cracklib-(__VER__)\.tar\.gz
michael@572 61 }
michael@572 62
michael@572 63 %prep
michael@572 64 %setup -q
michael@572 65
michael@572 66 %build
michael@572 67 # configure library
michael@572 68 CC="%{l_cc}" \
michael@572 69 CFLAGS="%{l_cflags -O}" \
michael@572 70 ./configure \
michael@572 71 --prefix=%{l_prefix} \
michael@572 72 --with-default-dict=%{l_prefix}/lib/cracklib/pw_dict \
michael@572 73 --without-python \
michael@572 74 --disable-shared \
michael@572 75 --disable-nls
michael@572 76
michael@572 77 # build library
michael@572 78 %{l_make} %{l_mflags}
michael@572 79
michael@572 80 %install
michael@572 81 # install library
michael@572 82 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@572 83
michael@572 84 # strip down installation files
michael@572 85 rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/create-cracklib-dict
michael@572 86 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/cracklib.magic
michael@572 87
michael@572 88 # install dictionaries
michael@572 89 mv $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/cracklib-small \
michael@572 90 $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/cracklib-small.txt
michael@572 91 %{l_gzip} -d -c %{SOURCE cracklib-words.gz} \
michael@572 92 >$RPM_BUILD_ROOT%{l_prefix}/share/cracklib/cracklib-large.txt
michael@572 93 %{l_gzip} -d -c %{SOURCE common-passwords.txt.gz} \
michael@572 94 >$RPM_BUILD_ROOT%{l_prefix}/share/cracklib/common-passwords.txt
michael@572 95 %{l_gzip} -d -c %{SOURCE Jargon.gz} \
michael@572 96 >$RPM_BUILD_ROOT%{l_prefix}/share/cracklib/jargon-words.txt
michael@572 97 cp %{SOURCE web2} \
michael@572 98 $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/freebsd-web2.txt
michael@572 99 cp %{SOURCE web2a} \
michael@572 100 $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/freebsd-web2a.txt
michael@572 101 cp %{SOURCE propernames} \
michael@572 102 $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/freebsd-propernames.txt
michael@572 103
michael@572 104 # install dictionary generation stuff
michael@572 105 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@572 106 %{SOURCE Makefile} $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/
michael@572 107 %{l_shtool} mkdir -f -p -m 755 \
michael@572 108 $RPM_BUILD_ROOT%{l_prefix}/lib/cracklib
michael@572 109
michael@572 110 # determine installation files
michael@572 111 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@572 112
michael@572 113 %files -f files
michael@572 114
michael@572 115 %clean
michael@572 116
michael@572 117 %post
michael@572 118 # (re-)generate run-time password dictionary
michael@572 119 ( echo "(Re-)Generating run-time password dictionary"
michael@572 120 ) | %{l_rpmtool} msg -b -t warn
michael@572 121 ( cd $RPM_INSTALL_PREFIX/share/cracklib && \
michael@572 122 $RPM_INSTALL_PREFIX/bin/make
michael@572 123 ) >/dev/null 2>&1
michael@572 124
michael@572 125 %preun
michael@572 126 if [ $1 -eq 0 ]; then
michael@572 127 rm -f $RPM_INSTALL_PREFIX/share/cracklib/* >/dev/null 2>&1 || true
michael@572 128 fi
michael@572 129

mercurial