- Build RPM from tarball.
- Install message catalogs in RPM.
- virt-p2v has new local repo (p2vrepo).
- rpmbuild/ subdirectory is just used for RPM builds.
- Exclude docs from packages.
^tftpboot/
^localrepo/
^rpmbuild/
+^p2vrepo/
^virt-p2v.spec$
^virt-p2v$
^po/Makefile$
\ No newline at end of file
# Build RPM of virt-p2v.
-rpm: checknotroot rpmbuild/$(VIRTP2V_RPM)
+rpm: checknotroot p2vrepo/$(VIRTP2V_RPM)
RPM_FLAGS := --define "_topdir %(pwd)/rpmbuild" \
- --define "_builddir %{_topdir}" \
- --define "_rpmdir %{_topdir}" \
- --define "_srcrpmdir %{_topdir}" \
- --define "_rpmfilename $(VIRTP2V_RPM)" \
- --define "_specdir %{_topdir}" \
+ --define "_builddir %{_topdir}/BUILD" \
+ --define "_rpmdir %{_topdir}/RPMS" \
+ --define "_srcrpmdir %{_topdir}/SRPMS" \
+ --define "_specdir %{_topdir}/SPECS" \
--define "_sourcedir %(pwd)"
-rpmbuild/$(VIRTP2V_RPM): \
+p2vrepo/$(VIRTP2V_RPM): \
virt-p2v.spec \
virt-p2v virt-p2v-update-wrapper iso-attach \
inittab
- mkdir -p rpmbuild
+ $(MAKE) dist
+ rm -rf rpmbuild
+ mkdir rpmbuild rpmbuild/{RPMS,BUILD,SRPMS,SPECS} rpmbuild/RPMS/noarch
rpmbuild $(RPM_FLAGS) -ba $<
- createrepo rpmbuild
+ mkdir -p p2vrepo
+ cp rpmbuild/RPMS/noarch/$(VIRTP2V_RPM) p2vrepo
+ createrepo p2vrepo
# Make the final script.
# A local repository if selected by ./configure --enable-localrepo=...
@LOCALREPO@
-# The rpmbuild subdirectory, containing virt-p2v RPM.
-repo --name=p2v --baseurl=file://@abs_top_builddir@/rpmbuild
+# The p2vrepo subdirectory, containing virt-p2v RPM.
+repo --name=p2v --baseurl=file://@abs_top_builddir@/p2vrepo
-%packages
+%packages --excludedocs
bash
kernel
syslinux
# Remove some unused files.
rm -rf /usr/share/man ;# 20 MB
-rm -rf /usr/share/doc ;# 44 MB
-rm -rf /usr/share/locale ;# 60 MB
+#rm -rf /usr/share/doc ;# 44 MB
+#rm -rf /usr/share/locale ;# 60 MB
%end
+%define debug_package %{nil}
+
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
-# Please keep the release as '1' for compatibility
-# with the Makefile.
+# Please keep the release as '1' for compatibility with the Makefile.
Release: 1
Summary: Virt-p2v
URL: http://et.redhat.com/~rjones/virt-p2v
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-#ExclusiveArch: noarch
+BuildArch: noarch
-Source0: virt-p2v
-Source1: virt-p2v-update-wrapper
-Source2: iso-attach
-Source3: inittab
+Source0: %{name}-%{version}.tar.gz
Requires: ocaml >= 3.10.0
Requires: ocaml-runtime
%prep
+%setup -q
%build
+%configure
+make virt-p2v
+make -C po
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
-install -m 0755 %{SOURCE0} %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}
-install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale
+install -m 0755 virt-p2v virt-p2v-update-wrapper iso-attach \
+ $RPM_BUILD_ROOT%{_bindir}
+install -m 0644 inittab $RPM_BUILD_ROOT%{_sysconfdir}
+make -C po install PODIR=$RPM_BUILD_ROOT%{_datadir}/locale
%clean
%defattr(-,root,root,-)
%{_bindir}/*
%{_sysconfdir}/*
+%{_datadir}/locale/*
%changelog