diff --git a/.cvsignore b/.cvsignore index e69de29..982a39d 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +captcha-2.2.nofont.tar.gz diff --git a/captcha-2.2-undef.patch b/captcha-2.2-undef.patch new file mode 100644 index 0000000..dd642a3 --- /dev/null +++ b/captcha-2.2-undef.patch @@ -0,0 +1,51 @@ +diff -Naur captcha-2.2.orig/captcha.php captcha-2.2.new/captcha.php +--- captcha-2.2.orig/captcha.php 2010-05-20 20:42:03.000000000 +0200 ++++ captcha-2.2.new/captcha.php 2010-05-25 12:10:39.000000000 +0200 +@@ -164,7 +164,7 @@ + + #-- init + srand(microtime() + time()/2 - 21017); +- if ($this->id) { $this->prev[] = $this->id; } ++ if (!empty($this->id)) { $this->prev[] = $this->id; } + $this->id = $this->new_id(); + + #-- meta informations +@@ -211,7 +211,7 @@ + + #-- examine if captcha data is fresh + function is_valid() { +- return isset($this->id) && ($this->created) ++ return isset($this->id) && !empty($this->created) + && ($this->expires > time()) + && ($this->tries > 0) + && ($this->failures < 500) +diff -Naur captcha-2.2.orig/index.php captcha-2.2.new/index.php +--- captcha-2.2.orig/index.php 2010-05-20 20:18:31.000000000 +0200 ++++ captcha-2.2.new/index.php 2010-05-25 12:18:13.000000000 +0200 +@@ -3,7 +3,7 @@ + // load library and preset a few options + define("CAPTCHA_INVERSE", 1); // black background + define("CAPTCHA_NEW_URLS", 0); // no auto-disabling/hiding for the demo +- include("captcha.php"); ++ include("captchaphp/captcha.php"); + + ?> + +@@ -109,7 +109,7 @@ + + + +-
++ + + +- get updates (freshmeat.net) ++ get updates (freshmeat.net) + | + download + | diff --git a/import.log b/import.log new file mode 100644 index 0000000..f47b0ef --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +php-captchaphp-2_2-2_fc12:HEAD:php-captchaphp-2.2-2.fc12.src.rpm:1278328936 diff --git a/php-captchaphp.spec b/php-captchaphp.spec new file mode 100644 index 0000000..f008f20 --- /dev/null +++ b/php-captchaphp.spec @@ -0,0 +1,127 @@ +# The original source of this package contains a font with a forbidden +# license. +# The attached source tarball idoes not contain this font and has been +# produced from the original by executing the following commands: +# +# wget http://milki.erphesfurt.de/captcha/captcha-%{version}.tgz +# tar xzf captcha-%{version}.tgz +# rm -f captcha-%{version}/MyUnderwood.* +# tar czf captcha-%{version}.nofont.tar.gz captcha-%{version} +# +# SHA1 sums: +# a0448d54623c9e394bbee90073a0d09d992aebda captcha-2.2.tgz +# 66fbdccc5f76d106eb3ff8fdb9c6af3441fe13fd captcha-2.2.nofont.tar.gz + +%global fontdir %{_datadir}/fonts/dejavu + +Name: php-captchaphp +Summary: PHP very user-friendly CAPTCHA solution +Version: 2.2 +Release: 2%{?dist} + +# Public Domain or any FOSS License, see README +# We're choosing MIT because it is universally compatible with other FOSS +# licenses. +License: Public Domain or MIT + +Group: System Environment/Libraries +URL: http://freshmeat.net/projects/captchaphp/ +Source0: captcha-%{version}.nofont.tar.gz +Patch1: captcha-2.2-undef.patch +Requires: php-gd >= 4.3.2 +Requires: %{fontdir} +Buildarch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + +%description + This PHP script provides a very user-friendly CAPTCHA solution. +You can easily embed it into your generation scripts to +prevent spam-bot access. + +It strives to be accessible and implements an arithmetic riddle +as alternative for visually impaired users. It does not require +cookies, but makes use of "AJAX" to give users visual feedback +for solving the CAPTCHA. It grants access fuzzily (when single +letters were outguessed) instead of frustrating people. And it +can be customized rather easily. + + +#------------------------------------------------------------------------------- +%prep +#------------------------------------------------------------------------------- + +%setup -q -n captcha-%{version} +%patch1 -p 1 + + +#------------------------------------------------------------------------------- +%build +#------------------------------------------------------------------------------- + +# Replace the font path by our (arbitrary) default font directory. + +sed -i -e "/CAPTCHA_FONT_DIR/s#,.*#, '%{fontdir}/');#" captcha.php + + +#------------------------------------------------------------------------------- +%install +#------------------------------------------------------------------------------- + +rm -rf "${RPM_BUILD_ROOT}" + +# Install directory. + +install -p -d -m 755 "${RPM_BUILD_ROOT}/%{_datadir}/php/captchaphp/" + + +# Install file. + +install -p -m 644 captcha.php "${RPM_BUILD_ROOT}/%{_datadir}/php/captchaphp/" + + +#------------------------------------------------------------------------------- +%clean +#------------------------------------------------------------------------------- + +rm -rf "${RPM_BUILD_ROOT}" + + +#------------------------------------------------------------------------------- +%files +#------------------------------------------------------------------------------- + +%defattr(-, root, root, -) +%doc README index.php +%{_datadir}/php/captchaphp + + +#------------------------------------------------------------------------------- +%changelog +#------------------------------------------------------------------------------- + +* Mon Jun 14 2010 Patrick Monnerat 2.2-2 +- Using MIT license. + +* Tue May 25 2010 Patrick Monnerat 2.2-1 +- New upstream release. + +* Mon Jul 13 2009 Patrick Monnerat 2.0-3 +- Depends on font directory rather than font package: this circumvents the + font package name change done between F10 and F11. + +* Tue Jun 23 2009 Patrick Monnerat 2.0-2 +- Move class files to a package-specific sub-directory. +- Get rid of build dependence on "ed". + +* Mon Jun 8 2009 Patrick Monnerat 2.0-1 +- Initial RPM spec file. +- Patch "nodeferror" to allow predefining CAPTCHA_* constants without + issuing an error at include time. +- Patch "https" to detect SSL use automatically. +- Patch "undef" to fix an undefined index error. +- Patch "directcall" to improve direct call detection. +- Patch "translatable" to make module translatable through the use of + additional CAPTCHA_* defines for texts. +- Font included in original package has an incompatible license: thus it + is not packaged. Instead, we use a reasonable default ttf font package and + directory. diff --git a/sources b/sources index e69de29..036317e 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +5a82c326f9c032cd77d94812826666b1 captcha-2.2.nofont.tar.gz