The following patches add some trivial cleanup to the 'make rpms' process. The bigger change is moving the %install logic from the medusa.spec into the distutils setup.py file. I've tested building packages, but have not *used* the built packages. Please advise if additional changes are needed.
The next step will be to cleanup 'rpmlint' WARNINGS and ERRORS to make way for official fedora packages.
Thanks, James
--- Medusa/.gitignore | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) create mode 100644 Medusa/.gitignore
diff --git a/Medusa/.gitignore b/Medusa/.gitignore new file mode 100644 index 0000000..9b64d3b --- /dev/null +++ b/Medusa/.gitignore @@ -0,0 +1,6 @@ +*.pyc +*.swp +*.tmp +dist +rpm-build +*.egg-info
--- Medusa/Makefile | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/Medusa/Makefile b/Medusa/Makefile index 6162538..317f18b 100644 --- a/Medusa/Makefile +++ b/Medusa/Makefile @@ -1,7 +1,7 @@ # $Id: $ PKGNAME=$(shell python setup.py --name) VERSION=$(shell python setup.py --version) -PKGRPMFLAGS=--define "_topdir ${PWD}" --define "_specdir ${PWD}" --define "_sourcedir ${PWD}/dist" --define "_srcrpmdir ${PWD}" --define "_rpmdir ${PWD}" --define "_builddir ${PWD}" +RPMBUILDOPTS=--define "_topdir ${PWD}/dist" --define "_specdir %{_topdir}" --define "_sourcedir %{_topdir}" --define "_srcrpmdir %{_topdir}" --define "_rpmdir %{_topdir}" --define "_builddir %{_topdir}" --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm"
default: all
@@ -21,6 +21,8 @@ todo:
clean: find . -name '*.pyc' | xargs rm -f + rm -rf medusa-* medusa.egg-info + rm -rf dist build rpm-build
dist: python setup.py sdist --formats=bztar @@ -29,13 +31,13 @@ build: python setup.py build
install: - python setup.py install -O1 --skip-build --root $(DESTDIR) + python setup.py install -f -O1 --skip-build
shell: tg-admin --config=medusa.cfg shell
srpm: dist - rpmbuild -ts dist/${PKGNAME}-${VERSION}.tar.bz2 + rpmbuild $(RPMBUILDOPTS) -ts dist/${PKGNAME}-${VERSION}.tar.bz2
pyflakes: find . -name '*.py' | xargs pyflakes @@ -50,6 +52,8 @@ install-deps: su -c "yum install TurboGears python-TurboMail python-fedora python-sqlalchemy koji mash yum-utils git intltool python-bugzilla python-genshi \ python-crypto python-imaging python-turboflot python-tgcaptcha python-nose.noarch"
+rpms: rpm + rpm: dist rpmbuild $(RPMBUILDOPTS) -tb dist/${PKGNAME}-${VERSION}.tar.bz2
Hi James, my only (post-mortem) comment is "rpms" and "rpm" targets should be made ".PHONY". Cheers, -- Marian
James Laska wrote:
Medusa/Makefile | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/Medusa/Makefile b/Medusa/Makefile index 6162538..317f18b 100644 --- a/Medusa/Makefile +++ b/Medusa/Makefile @@ -1,7 +1,7 @@ # $Id: $ PKGNAME=$(shell python setup.py --name) VERSION=$(shell python setup.py --version) -PKGRPMFLAGS=--define "_topdir ${PWD}" --define "_specdir ${PWD}" --define "_sourcedir ${PWD}/dist" --define "_srcrpmdir ${PWD}" --define "_rpmdir ${PWD}" --define "_builddir ${PWD}" +RPMBUILDOPTS=--define "_topdir ${PWD}/dist" --define "_specdir %{_topdir}" --define "_sourcedir %{_topdir}" --define "_srcrpmdir %{_topdir}" --define "_rpmdir %{_topdir}" --define "_builddir %{_topdir}" --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm"
default: all
@@ -21,6 +21,8 @@ todo:
clean: find . -name '*.pyc' | xargs rm -f
- rm -rf medusa-* medusa.egg-info
- rm -rf dist build rpm-build
dist: python setup.py sdist --formats=bztar @@ -29,13 +31,13 @@ build: python setup.py build
install:
- python setup.py install -O1 --skip-build --root $(DESTDIR)
- python setup.py install -f -O1 --skip-build
shell: tg-admin --config=medusa.cfg shell
srpm: dist
- rpmbuild -ts dist/${PKGNAME}-${VERSION}.tar.bz2
- rpmbuild $(RPMBUILDOPTS) -ts dist/${PKGNAME}-${VERSION}.tar.bz2
pyflakes: find . -name '*.py' | xargs pyflakes @@ -50,6 +52,8 @@ install-deps: su -c "yum install TurboGears python-TurboMail python-fedora python-sqlalchemy koji mash yum-utils git intltool python-bugzilla python-genshi \ python-crypto python-imaging python-turboflot python-tgcaptcha python-nose.noarch"
+rpms: rpm
rpm: dist rpmbuild $(RPMBUILDOPTS) -tb dist/${PKGNAME}-${VERSION}.tar.bz2
On Tue, 2009-04-14 at 16:09 +0200, Marian Csontos wrote:
Hi James, my only (post-mortem) comment is "rpms" and "rpm" targets should be made ".PHONY".
Thanks for the feedback Marian. I've never quite understood what .PHONY is for, have any good doc links?
Attached requested patch.
Thanks, James
James Laska wrote:
On Tue, 2009-04-14 at 16:09 +0200, Marian Csontos wrote:
Hi James, my only (post-mortem) comment is "rpms" and "rpm" targets should be made ".PHONY".
Thanks for the feedback Marian. I've never quite understood what .PHONY is for, have any good doc links?
Attached requested patch.
Thanks, James
Thanks guys. patched and committed.
Beaker-devel mailing list Beaker-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/beaker-devel
It prevents a problem with existing file with same name as the target: If the file is newer than its dependencies, target will be never rebuilt.
Here the .PHONY target dist is in dependencies, and I guess in this case it would work, but I am not sure. However, at least in make's info-pages I saw such targets added target to .PHONY list. See: http://www.gnu.org/software/automake/manual/make/Phony-Targets.html
Cheers, Marian
James Laska wrote:
On Tue, 2009-04-14 at 16:09 +0200, Marian Csontos wrote:
Hi James, my only (post-mortem) comment is "rpms" and "rpm" targets should be made ".PHONY".
Thanks for the feedback Marian. I've never quite understood what .PHONY is for, have any good doc links?
Attached requested patch.
Thanks, James
--- Medusa/medusa.spec | 105 ++++++++++++++++++++-------------------------------- Medusa/setup.py | 15 ++++++- 2 files changed, 53 insertions(+), 67 deletions(-)
diff --git a/Medusa/medusa.spec b/Medusa/medusa.spec index ea5e06b..96f326a 100644 --- a/Medusa/medusa.spec +++ b/Medusa/medusa.spec @@ -9,100 +9,73 @@ Group: Applications/Internet License: GPLv2+ URL: https://fedorahosted.org/beaker Source0: medusa-%{version}.tar.bz2 - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch +BuildRequires: python-setuptools +BuildRequires: python-setuptools-devel +BuildRequires: python-devel +BuildRequires: TurboGears
-BuildRequires: python-setuptools -BuildRequires: python-setuptools-devel -BuildRequires: python-devel - -BuildRequires: TurboGears
%description To Be Filled in
+ %package server -Summary: Server component of Medusa -Group: Applications/Internet -Requires: TurboGears -Requires: intltool -Requires: python-decorator -Requires: python-xmltramp -Requires: python-ldap -Requires: mod_wsgi -Requires: python-tgexpandingformwidget -Requires: httpd -Requires: python-krbV +Summary: Server component of Medusa +Group: Applications/Internet +Requires: TurboGears +Requires: intltool +Requires: python-decorator +Requires: python-xmltramp +Requires: python-ldap +Requires: mod_wsgi +Requires: python-tgexpandingformwidget +Requires: httpd +Requires: python-krbV +Requires: python-cpio +
%package lab-controller -Summary: Lab Controller xmlrpc server -Group: Applications/Internet -Requires: python -Requires: mod_python -Requires: httpd -Requires: cobbler >= 1.4 -Requires: yum-utils -Requires: /sbin/fenced -Requires: telnet +Summary: Lab Controller xmlrpc server +Group: Applications/Internet +Requires: python +Requires: mod_python +Requires: httpd +Requires: cobbler >= 1.4 +Requires: yum-utils +Requires: /sbin/fenced +Requires: telnet +
%description server To Be Filled in - Server Side..
+ %description lab-controller This is the interface to link Medusa and Cobbler together. Mostly provides snippets and kickstarts.
+ %prep %setup -q rm -rf medusa/tests medusa/tools/test-medusa.py
+ %build %{__python} setup.py build --install-data=%{_datadir}
+ %install %{__rm} -rf %{buildroot} %{__python} setup.py install -O1 --skip-build \ --install-data=%{_datadir} --root %{buildroot}
-%{__mkdir_p} %{buildroot}/var/lib/medusa -%{__mkdir_p} %{buildroot}/var/www/beaker -%{__mkdir_p} %{buildroot}%{_sysconfdir}/httpd/conf.d -%{__mkdir_p} %{buildroot}%{_sysconfdir}/medusa -%{__mkdir_p} %{buildroot}%{_datadir}/%{name} -%{__mkdir_p} -m 0755 %{buildroot}/%{_localstatedir}/log/medusa -touch %{buildroot}/%{_localstatedir}/log/medusa/server.log - -%{__install} -m 640 apache/%{name}.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf -%{__install} -m 640 %{name}.cfg %{buildroot}%{_sysconfdir}/%{name}/ -%{__install} apache/%{name}.wsgi %{buildroot}%{_datadir}/%{name}/%{name}.wsgi -%{__install} apache/xmlrpc_auth.wsgi %{buildroot}%{_datadir}/%{name}/xmlrpc_auth.wsgi - -#lab-controller files -%{__mkdir_p} %{buildroot}/%{_sysconfdir}/cron.daily -%{__mkdir_p} %{buildroot}/var/lib/cobbler/triggers/sync/post -%{__mkdir_p} %{buildroot}/var/lib/cobbler/triggers/install/pre -%{__mkdir_p} %{buildroot}/var/lib/cobbler/snippets -%{__mkdir_p} %{buildroot}/var/lib/cobbler/kickstarts - -%{__install} -m 740 lab-controller/cron.daily/expire_distros %{buildroot}%{_sysconfdir}/cron.daily/ -%{__install} lab-controller/triggers/sync/post/osversion.trigger %{buildroot}/var/lib/cobbler/triggers/sync/post/ -%{__install} lab-controller/triggers/install/pre/clear_console_log.trigger %{buildroot}/var/lib/cobbler/triggers/install/pre/ -%{__install} lab-controller/snippets/rhts_partitions %{buildroot}/var/lib/cobbler/snippets -%{__install} lab-controller/snippets/rhts_packages %{buildroot}/var/lib/cobbler/snippets -%{__install} lab-controller/snippets/rhts_pre %{buildroot}/var/lib/cobbler/snippets -%{__install} lab-controller/snippets/rhts_post %{buildroot}/var/lib/cobbler/snippets -%{__install} lab-controller/kickstarts/rhel3.ks %{buildroot}/var/lib/cobbler/kickstarts -%{__install} lab-controller/kickstarts/rhel4.ks %{buildroot}/var/lib/cobbler/kickstarts -%{__install} lab-controller/kickstarts/rhel5.ks %{buildroot}/var/lib/cobbler/kickstarts -%{__install} lab-controller/kickstarts/fedora.ks %{buildroot}/var/lib/cobbler/kickstarts -%{__install} lab-controller/aux/rhts-checkin %{buildroot}/var/www/beaker/ -%{__install} -m 640 lab-controller/lib/cpioarchive.py %{buildroot}%{python_sitelib}/cpioarchive.py -
%clean %{__rm} -rf %{buildroot}
+ %files server %defattr(-,root,root,-) %doc README COPYING @@ -112,20 +85,22 @@ touch %{buildroot}/%{_localstatedir}/log/medusa/server.log %config(noreplace) %{_sysconfdir}/httpd/conf.d/medusa.conf %attr(-,apache,root) %{_datadir}/%{name} %attr(-,apache,root) %config(noreplace) %{_sysconfdir}/medusa/* -%attr(-,apache,root) %{_localstatedir}/log/medusa %{python_sitelib}/%{name}-%{version}-py%{pyver}.egg-info/ +%dir %{_localstatedir}/lib/medusa +%attr(-,apache,root) %dir %{_localstatedir}/log/medusa +
%files lab-controller %defattr(-,root,root,-) %doc lab-controller/README %{_sysconfdir}/cron.daily/expire_distros -%{python_sitelib}/cpioarchive.py* /var/lib/cobbler/triggers/sync/post/osversion.trigger /var/lib/cobbler/triggers/install/pre/clear_console_log.trigger /var/lib/cobbler/snippets/* /var/lib/cobbler/kickstarts/* /var/www/beaker/rhts-checkin
+ %changelog * Tue Mar 17 2009 Bill Peck bpeck@redhat.com - 0.2-81 - Fix kerberos auth to be more generic. any apache auth is possible now. @@ -167,7 +142,7 @@ touch %{buildroot}/%{_localstatedir}/log/medusa/server.log - filter distros by virt. * Mon Feb 16 2009 Bill Peck bpeck@redhat.com - 0.2-63 - broke key_values into separate int and string tables. -- hopefully fixed available/free queries +- hopefully fixed available/free queries
* Fri Feb 13 2009 Bill Peck bpeck@redhat.com - 0.2-62 - try number 2 on favicon.ico @@ -176,7 +151,7 @@ touch %{buildroot}/%{_localstatedir}/log/medusa/server.log - added favicon.ico and fixed group lookup.
* Thu Feb 12 2009 Bill Peck bpeck@redhat.com - 0.2-60 -- added robots.txt +- added robots.txt
* Thu Feb 12 2009 Bill Peck bpeck@redhat.com - 0.2-59 - fix for importing tree info @@ -262,7 +237,7 @@ touch %{buildroot}/%{_localstatedir}/log/medusa/server.log - Added system type filter method
* Tue Feb 03 2009 Bill Peck bpeck@redhat.com - 0.2-32 -- Added system_validate method +- Added system_validate method
* Tue Feb 03 2009 Bill Peck bpeck@redhat.com - 0.2-31 - Updates for RHTS integration, lab controller selection. diff --git a/Medusa/setup.py b/Medusa/setup.py index 37c0662..79e618f 100644 --- a/Medusa/setup.py +++ b/Medusa/setup.py @@ -121,6 +121,17 @@ data_files = [ glob.glob('medusa/static/javascript/*'))), ('medusa/static/images', filter(os.path.isfile, glob.glob('medusa/static/images/*'))), + ("/etc/medusa", ["medusa.cfg"]), + ("/etc/cron.daily", ["lab-controller/cron.daily/expire_distros"]), + ("/etc/httpd/conf.d", ["apache/medusa.conf"]), + ("/var/lib/cobbler/triggers/sync/post", filter(os.path.isfile, glob.glob("lab-controller/triggers/sync/post/*"))), + ("/var/lib/cobbler/triggers/install/pre", filter(os.path.isfile, glob.glob("lab-controller/triggers/install/pre/*"))), + ("/var/lib/cobbler/kickstarts", filter(os.path.isfile, glob.glob("lab-controller/kickstarts/*"))), + ("/var/lib/cobbler/snippets", filter(os.path.isfile, glob.glob("lab-controller/snippets/*"))), + ("/usr/share/medusa", filter(os.path.isfile, glob.glob("apache/*.wsgi"))), + ("/var/www/beaker", ["lab-controller/aux/rhts-checkin"]), + ("/var/log/medusa", []), + ("/var/lib/medusa", []), ]
packages=find_packages() @@ -156,8 +167,8 @@ setup( scripts=[], zip_safe=False, data_files = data_files, - packages=find_packages(), - package_data=package_data, + packages = find_packages(), + package_data = package_data, keywords=[ 'turbogears.app', ],
James Laska wrote:
The following patches add some trivial cleanup to the 'make rpms' process. The bigger change is moving the %install logic from the medusa.spec into the distutils setup.py file. I've tested building packages, but have not *used* the built packages. Please advise if additional changes are needed.
The next step will be to cleanup 'rpmlint' WARNINGS and ERRORS to make way for official fedora packages.
Thanks, James
These look good. All committed to master.
Thanks!
beaker-devel@lists.fedorahosted.org