[yourls] Initial import (#726131).
Martin Krizek
mkrizek at fedoraproject.org
Thu Aug 25 13:49:39 UTC 2011
commit 3aab1e89fd91347c9fc9f753c2fc86dc8dbe433a
Author: Martin Krizek <mkrizek at redhat.com>
Date: Thu Aug 25 15:49:00 2011 +0200
Initial import (#726131).
.gitignore | 1 +
sources | 1 +
yourls-httpd.conf | 5 ++
yourls.change-config-path.patch | 18 +++++++++
yourls.spec | 80 +++++++++++++++++++++++++++++++++++++++
5 files changed, 105 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..6cc9bbc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/yourls-1.5.zip
diff --git a/sources b/sources
index e69de29..77cf5d3 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+fa32943f7d669640f08670ecdcde5ad1 yourls-1.5.zip
diff --git a/yourls-httpd.conf b/yourls-httpd.conf
new file mode 100644
index 0000000..7e21257
--- /dev/null
+++ b/yourls-httpd.conf
@@ -0,0 +1,5 @@
+Alias /yourls /usr/share/yourls
+
+<Directory /usr/share/yourls>
+ AllowOverride All
+</Directory>
diff --git a/yourls.change-config-path.patch b/yourls.change-config-path.patch
new file mode 100644
index 0000000..364e2db
--- /dev/null
+++ b/yourls.change-config-path.patch
@@ -0,0 +1,18 @@
+--- includes/load-yourls.php.orig 2011-08-15 18:37:13.291923132 +0200
++++ includes/load-yourls.php 2011-08-15 18:38:04.011434893 +0200
+@@ -2,12 +2,9 @@
+ // This file initialize everything needed for YOURLS
+
+ // Include settings
+-if( file_exists(dirname(__FILE__).'/config.php') ) {
+- // config.php in /includes/
+- require_once( dirname(__FILE__).'/config.php' );
+-} elseif ( file_exists(dirname(dirname(__FILE__)).'/user/config.php') ) {
+- // config.php in /user/
+- require_once( dirname(dirname(__FILE__)).'/user/config.php' );
++if( file_exists('/etc/yourls/config.php') ) {
++ // config.php in /etc/yourls/
++ require_once( '/etc/yourls/config.php' );
+ } else {
+ // config.php not found :(
+ die('<p class="error">Cannot find <tt>config.php</tt>.</p><p>Please read the <tt>readme.html</tt> to learn how to install YOURLS</p>');
diff --git a/yourls.spec b/yourls.spec
new file mode 100644
index 0000000..af3ce94
--- /dev/null
+++ b/yourls.spec
@@ -0,0 +1,80 @@
+Name: yourls
+Version: 1.5
+Release: 4%{?dist}
+Summary: Your Own URL Shortener
+Group: Applications/Internet
+# License scenario:
+# * yourls files: GPL+
+# * GeoIP files: LGPLv2+
+# * JQuery files: MIT or GPLv2
+License: GPL+ and LGPLv2+ and (MIT or GPLv2)
+URL: http://yourls.org
+Source0: http://%{name}.googlecode.com/files/%{name}-%{version}.zip
+Source1: yourls-httpd.conf
+Patch0: yourls.change-config-path.patch
+Requires: php >= 4.3.0, mysql >= 4.1.0, httpd, php-mysql
+BuildArch: noarch
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXX)
+
+
+%description
+YOURLS is a small set of PHP scripts that will allow you to run your own URL
+shortening service (a la TinyURL). You can make it private or public,
+you can pick custom keyword URLs, it comes with its own API.
+
+
+%prep
+%setup -q -c %{name}-%{version}
+%patch0
+# Remove DOS line endings
+for f in *.txt; do
+ sed 's/\r//' $f > $f.new &&
+ touch -r $f $f.new &&
+ mv $f.new $f
+done
+
+
+%build
+
+
+%install
+rm -rf ${RPM_BUILD_ROOT}
+mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}
+mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}
+install -m 0644 -D -p %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/yourls.conf
+cp -ad ./* ${RPM_BUILD_ROOT}%{_datadir}/%{name}
+mv ./includes/config-sample.php ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/config.php
+
+# Remove docs from datadir, to be put in defaultdocdir later
+rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/{changelog.txt,readme.html,sample-*}
+
+
+%clean
+rm -rf ${RPM_BUILD_ROOT}
+
+
+%files
+%defattr(-,root,root,-)
+%config(noreplace) %{_sysconfdir}/%{name}/config.php
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/yourls.conf
+%doc changelog.txt readme.html sample-public-api.php.txt
+%doc sample-public-front-page.php.txt sample-remote-api-call.php.txt
+%dir %{_sysconfdir}/%{name}/
+%{_datadir}/%{name}/
+
+
+%changelog
+* Tue Aug 23 2011 Martin Krizek <mkrizek at redhat.com> - 1.5-4
+- Fixed license
+- Fixed DOC line endings in the doc files
+
+* Mon Aug 15 2011 Martin Krizek <mkrizek at redhat.com> - 1.5-3
+- Editing source is now done with patch instead of sed
+
+* Wed Aug 02 2011 Martin Krizek <mkrizek at redhat.com> - 1.5-2
+- Fixed wrong version of license
+- Made calling sed in prep section more readable
+
+* Wed Jul 27 2011 Martin Krizek <mkrizek at redhat.com> - 1.5-1
+- Initial packaging
+
More information about the scm-commits
mailing list