rpms/mrepo/EL-5 mrepo-initd.patch, NONE, 1.1 mrepo.spec, NONE, 1.1 sources, 1.1, 1.2

Jussi Lehtola jussilehtola at fedoraproject.org
Sun Jul 12 19:01:40 UTC 2009


Author: jussilehtola

Update of /cvs/pkgs/rpms/mrepo/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23757/EL-5

Modified Files:
	sources 
Added Files:
	mrepo-initd.patch mrepo.spec 
Log Message:
Imported in Fedora.

mrepo-initd.patch:

--- NEW FILE mrepo-initd.patch ---
diff -up mrepo-0.8.4/config/mrepo.orig mrepo-0.8.4/config/mrepo
--- mrepo-0.8.4/config/mrepo.orig	2006-12-08 21:53:27.000000000 +0200
+++ mrepo-0.8.4/config/mrepo	2009-05-20 11:14:35.000000000 +0300
@@ -4,74 +4,94 @@
 #
 # Written by Dag Wieers <dag at wieers.com>.
 #
-# chkconfig: 2345 90 10
+# chkconfig: - 20 80
 # description: mrepo distribution server.
 #
 # processname: mrepo
 # config: /etc/mrepo.conf
 
-source /etc/rc.d/init.d/functions
+# Source function library.
+. /etc/rc.d/init.d/functions
 
-[ -x /usr/bin/mrepo ] || exit 1
-
-### Default variables
-SYSCONFIG="/etc/sysconfig/mrepo"
-YAMCONFIG="/etc/mrepo.conf"
-
-### Read configuration
-[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"
+exec="mrepo"
+prog="mrepo"
+config="/etc/mrepo.conf"
 
-[ -r "$YAMCONFIG" ] || exit 1
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
 
-RETVAL=0
-prog="mrepo"
-desc="rpm distribution server"
+lockfile=/var/lock/subsys/$prog
 
 start() {
-	echo -n $"Starting $desc ($prog): "
-	mrepo -q -c $YAMCONFIG
-	RETVAL=$?
-	[ $RETVAL -eq 0 ] && success || failure
-	echo
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
-	return $RETVAL
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    mrepo -q -c $config
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
 }
 
 stop() {
-	echo -n $"Shutting down $desc ($prog): "
-	mrepo -q --umount -c $YAMCONFIG
-	RETVAL=$?
-	[ $RETVAL -eq 0 ] && success || failure
-	echo
-	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
-	return $RETVAL
+    echo -n $"Stopping $prog: "
+    mrepo -q --umount -c $config
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
 }
 
 restart() {
-	stop
-	start
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    # run checks to determine if the service is running or use generic status
+    status $prog
 }
 
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
 case "$1" in
-  start)
-	start
-	;;
-  stop)
-	stop
-	;;
-  restart|reload)
-	restart
-	;;
-  reload)
-	reload
-	;;
-  condrestart)
-	[ -e /var/lock/subsys/$prog ] && restart
-	RETVAL=$?
-	;;
-  *)
-	echo $"Usage: $0 {start|stop|restart|condrestart}"
-	RETVAL=1
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
 esac
-
-exit $RETVAL
+exit $?


--- NEW FILE mrepo.spec ---
Name:		mrepo
Version:	0.8.6
Release:	2%{?dist}
Summary:	A tool to set up a yum/apt mirror from various sources
License:	GPLv2
Group:		System Environment/Base
URL:		http://dag.wieers.com/home-made/mrepo/
Source0:	http://dag.wieers.com/home-made/mrepo/mrepo-%{version}.tar.bz2
# Patch initfile to conform to new standards
Patch0:		mrepo-initd.patch
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch:	noarch

BuildRequires:	python-devel

# Needed for operation
Requires:	createrepo
## For dir ownership
# vixie-cron in older distros, cronie in newer ones; filelist always available
Requires:	%{_sbindir}/crond
Requires:	httpd
Requires:	logrotate

# For services
Requires(post):		chkconfig
Requires(preun):	chkconfig
Requires(preun):	initscripts
Requires(postun):	initscripts


%description
mrepo builds a local Apt/Yum RPM repository from local ISO files,
downloaded updates and extra packages from RHN and 3rd party
repositories.

It can download all updates and extras automatically, creates
the repository structure and meta-data, enables HTTP access to
the repository and creates a directory-structure for remote
network installations using PXE/TFTP.

mrepo supports ftp, http, sftp, rsync, rhn and other download methods.

With mrepo, you can enable your laptop or a local server to provide
updates for the whole network and provide the proper files to
allow installations via the network.

%prep
%setup -q
%patch0 -p1 -b .init

# Stop if file has content, remove empty file
[ -s client-configuration.txt ] && exit 1
rm docs/client-configuration.txt

perl -pi.orig -e 's|^(VERSION)\s*=\s*.+$|$1 = "%{version}"|' mrepo

cat <<EOF >config/mrepo.cron
### Enable this if you want mrepo to daily synchronize
### your distributions and repositories at 2:30am.
#30 2 * * * root /usr/bin/mrepo -q -ug
EOF

cat <<EOF >config/mrepo.conf
### Configuration file for mrepo

### The [main] section allows to override mrepo's default settings
### The mrepo-example.conf gives an overview of all the possible settings
[main]
srcdir = /var/mrepo
wwwdir = /var/www/mrepo
confdir = /etc/mrepo.conf.d
arch = i386 

mailto = root at localhost
smtp-server = localhost

#rhnlogin = username:password

### Any other section is considered a definition for a distribution
### You can put distribution sections in /etc/mrepo.conf.d/
### Examples can be found in the documentation at:
### %{_docdir}/%{name}-%{version}/dists/.
EOF

%build

%install
rm -rf %{buildroot}
make install DESTDIR="%{buildroot}"

%post
/sbin/chkconfig --add mrepo

%preun
if [ $1 = 0 ]; then
	/sbin/service mrepo stop >/dev/null 2>&1 || :
	/sbin/chkconfig --del mrepo
fi

%postun
if [ "$1" -ge "1" ] ; then
    /sbin/service mrepo condrestart >/dev/null 2>&1 || :
fi

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README THANKS TODO WISHLIST config/*.conf config/dists/ docs/*
%config(noreplace) %{_sysconfdir}/cron.d/mrepo
%config(noreplace) %{_sysconfdir}/httpd/conf.d/mrepo.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/mrepo
%config(noreplace) %{_sysconfdir}/mrepo.conf
%config(noreplace) %{_sysconfdir}/mrepo.conf.d/
%{_initddir}/mrepo
%{_bindir}/gensystemid
%{_bindir}/rhnget
%{_bindir}/mrepo
%{_bindir}/youget
%{_datadir}/mrepo/
%{_localstatedir}/cache/mrepo/
%{_localstatedir}/www/mrepo/
%{_localstatedir}/mrepo/

%changelog
* Sun Jul 12 2009 Jussi Lehtola <jussi.lehtola at iki.fi> - 0.8.6-2
- Review fixes.

* Sun Jul 12 2009 Jussi Lehtola <jussi.lehtola at iki.fi> - 0.8.6-1
- Update to 0.8.6.

* Wed May 20 2009 Jussi Lehtola <jussi.lehtola at iki.fi> - 0.8.4-2
- Spec modifications for inclusion into Fedora.

* Wed Dec 13 2006 Dag Wieers <dag at wieers.com> - 0.8.4-1
- Updated to release 0.8.4.
- Package renamed from yam to mrepo.

* Sat Oct 21 2006 Dag Wieers <dag at wieers.com> - 0.8.3-2
- Get rid of specific createrepo version now that Yam works with upstream.

* Sun Oct 15 2006 Dag Wieers <dag at wieers.com> - 0.8.3-1
- Updated to release 0.8.3.

* Wed Sep 20 2006 Dag Wieers <dag at wieers.com> - 0.8.2-1
- Updated to release 0.8.2.

* Fri Mar 10 2006 Dag Wieers <dag at wieers.com> - 0.8.0-2
- Added gensystemid to installation. (Ian Forde)

* Thu Mar 09 2006 Dag Wieers <dag at wieers.com> - 0.8.0-1
- Updated to release 0.8.0.

* Fri Mar 25 2005 Dag Wieers <dag at wieers.com> - 0.7.3-1
- Updated to release 0.7.3.

* Fri Jan 07 2005 Dag Wieers <dag at wieers.com> - 0.7.2-2
- Add %%post and %%postun scripts. (Bert de Bruijn)

* Fri Dec 31 2004 Dag Wieers <dag at wieers.com> - 0.7.2-1
- Updated to release 0.7.2.

* Sun Nov 07 2004 Dag Wieers <dag at wieers.com> - 0.7.1-1
- Updated to release 0.7.1.

* Sun Oct 10 2004 Dag Wieers <dag at wieers.com> - 0.7-1
- Updated to release 0.7.

* Fri Aug 27 2004 Dag Wieers <dag at wieers.com> - 0.6.1-1
- Updated to release 0.6.1.

* Wed Aug 25 2004 Dag Wieers <dag at wieers.com> - 0.6-2
- Updated to release 0.6.
- Fix a version problem.

* Thu Aug 19 2004 Dag Wieers <dag at wieers.com> - 0.5-1
- Updated to release 0.5.

* Wed May 19 2004 Dag Wieers <dag at wieers.com> - 0.3-1
- Updated to release 0.3.

* Fri May 14 2004 Dag Wieers <dag at wieers.com> - 0.2-1
- Initial package. (using DAR)


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/mrepo/EL-5/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	12 Jul 2009 17:19:36 -0000	1.1
+++ sources	12 Jul 2009 19:01:10 -0000	1.2
@@ -0,0 +1 @@
+1d6122cc21ee74cc9211d181011fb618  mrepo-0.8.6.tar.bz2




More information about the fedora-extras-commits mailing list