michael@572: ## michael@572: ## cracklib.spec -- OpenPKG RPM Package Specification michael@572: ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. michael@572: ## michael@572: ## Permission to use, copy, modify, and distribute this software for michael@572: ## any purpose with or without fee is hereby granted, provided that michael@572: ## the above copyright notice and this permission notice appear in all michael@572: ## copies. michael@572: ## michael@572: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@572: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@572: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@572: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@572: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@572: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@572: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@572: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@572: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@572: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@572: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@572: ## SUCH DAMAGE. michael@572: ## michael@572: michael@572: # package information michael@572: Name: cracklib michael@572: Summary: Filter Guessable Passwords michael@572: URL: http://cracklib.sourceforge.net/ michael@572: Vendor: Alec Muffett et al. michael@572: Packager: OpenPKG Foundation e.V. michael@572: Distribution: OpenPKG Community michael@572: Class: PLUS michael@572: Group: Security michael@572: License: Artistic michael@572: Version: 2.8.19 michael@573: Release: 20120800 michael@572: michael@572: # list of sources michael@572: Source0: http://switch.dl.sourceforge.net/cracklib/cracklib-%{version}.tar.gz michael@572: Source1: http://switch.dl.sourceforge.net/cracklib/cracklib-words.gz michael@572: Source2: ftp://ftp.cerias.purdue.edu/pub/dict/wordlists/computer/common-passwords.txt.gz michael@572: Source3: ftp://ftp.cerias.purdue.edu/pub/dict/wordlists/computer/Jargon.gz michael@572: Source4: http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/share/dict/web2 michael@572: Source5: http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/share/dict/web2a michael@572: Source6: http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/share/dict/propernames michael@572: Source7: Makefile michael@572: michael@572: # build information michael@572: BuildPreReq: OpenPKG, openpkg >= 20100101, make michael@572: PreReq: OpenPKG, openpkg >= 20100101, make michael@572: michael@572: %description michael@572: CrackLib is a library which may be used in a "passwd"-like program. michael@572: The idea is simple: try to prevent users from choosing passwords michael@572: that could be guessed by "Crack" by filtering them out, at source. michael@572: michael@572: %track michael@572: prog cracklib = { michael@572: version = %{version} michael@572: url = http://sourceforge.net/projects/cracklib/files/ michael@572: regex = cracklib-(__VER__)\.tar\.gz michael@572: } michael@572: michael@572: %prep michael@572: %setup -q michael@572: michael@572: %build michael@572: # configure library michael@572: CC="%{l_cc}" \ michael@572: CFLAGS="%{l_cflags -O}" \ michael@573: CPPFLAGS="%{l_cppflags} -D_POSIX_PTHREAD_SEMANTICS" \ michael@572: ./configure \ michael@572: --prefix=%{l_prefix} \ michael@572: --with-default-dict=%{l_prefix}/lib/cracklib/pw_dict \ michael@572: --without-python \ michael@572: --disable-shared \ michael@572: --disable-nls michael@572: michael@572: # build library michael@573: %{l_make} %{l_mflags -O} michael@572: michael@572: %install michael@572: # install library michael@572: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@572: michael@572: # strip down installation files michael@572: rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/create-cracklib-dict michael@572: rm -f $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/cracklib.magic michael@572: michael@572: # install dictionaries michael@572: mv $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/cracklib-small \ michael@572: $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/cracklib-small.txt michael@572: %{l_gzip} -d -c %{SOURCE cracklib-words.gz} \ michael@572: >$RPM_BUILD_ROOT%{l_prefix}/share/cracklib/cracklib-large.txt michael@572: %{l_gzip} -d -c %{SOURCE common-passwords.txt.gz} \ michael@572: >$RPM_BUILD_ROOT%{l_prefix}/share/cracklib/common-passwords.txt michael@572: %{l_gzip} -d -c %{SOURCE Jargon.gz} \ michael@572: >$RPM_BUILD_ROOT%{l_prefix}/share/cracklib/jargon-words.txt michael@572: cp %{SOURCE web2} \ michael@572: $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/freebsd-web2.txt michael@572: cp %{SOURCE web2a} \ michael@572: $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/freebsd-web2a.txt michael@572: cp %{SOURCE propernames} \ michael@572: $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/freebsd-propernames.txt michael@572: michael@572: # install dictionary generation stuff michael@572: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@572: %{SOURCE Makefile} $RPM_BUILD_ROOT%{l_prefix}/share/cracklib/ michael@572: %{l_shtool} mkdir -f -p -m 755 \ michael@572: $RPM_BUILD_ROOT%{l_prefix}/lib/cracklib michael@572: michael@572: # determine installation files michael@572: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} michael@572: michael@572: %files -f files michael@572: michael@572: %clean michael@572: michael@572: %post michael@573: # (re)generate runtime password dictionary michael@573: ( echo "(Re)Generating runtime password dictionary" michael@572: ) | %{l_rpmtool} msg -b -t warn michael@572: ( cd $RPM_INSTALL_PREFIX/share/cracklib && \ michael@572: $RPM_INSTALL_PREFIX/bin/make michael@572: ) >/dev/null 2>&1 michael@572: michael@572: %preun michael@572: if [ $1 -eq 0 ]; then michael@572: rm -f $RPM_INSTALL_PREFIX/share/cracklib/* >/dev/null 2>&1 || true michael@572: fi michael@572: