OSDN Git Service

LinGui: add RPM packaging support and modify Debian so they can co-exist
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 20 Jun 2009 03:07:57 +0000 (03:07 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 20 Jun 2009 03:07:57 +0000 (03:07 +0000)
- make pkg.create.rpm will create rpm packages
- make pkg.create.deb will create debian packages

git-svn-id: svn://localhost/HandBrake/trunk@2583 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/Makefile.am
gtk/ghb.spec
pkg/linux/debian/handbrake-gtk.dirs
pkg/linux/debian/handbrake-gtk.install
pkg/linux/module.defs
pkg/linux/module.rules

index 069ded1..19050d9 100644 (file)
@@ -4,8 +4,6 @@
 SUBDIRS = src po
 
 ghbdocdir = ${prefix}/share/doc/ghb
-ghbdoc_DATA = \
-       ChangeLog
 
 EXTRA_DIST = $(ghbdoc_DATA)
 
index 83cdab4..e164ccb 100644 (file)
@@ -1,32 +1,55 @@
-Name:          handbrake
-Version:       0.9.2
-Release:       1%{?dist}
-Summary:       A program to rip and encode DVDs and other sources to MPEG-4
+%define name HandBrake
+%define release 1
+
+Name:          %{name}
+Version:       %{version}
+Release:       %{release}%{?dist}
+Summary:       A program to transcode DVDs and other sources to MPEG-4
 
 Group:         Applications/Multimedia
 License:       GPL
 URL:           http://handbrake.fr/
-Source0:       HandBrake.tgz
+Vendor:                The HandBrake Project
+Source0:       %{name}-%{version}.tar.bz2
+Prefix:                %{_prefix}
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-Requires:      glib2 >= 2.16, gtk2 >= 2.12, hal-libs
+Requires:      glib2 >= 2.16, gtk2 >= 2.12, hal-libs, webkitgtk, gstreamer
+Requires:      gstreamer-plugins-base
 
 %description
 HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded 
-DVD to MPEG-4 converter, available for MacOS X, Linux and Windows.
+transcoder, available for MacOS X, Linux and Windows.
+
+%package gui
+Summary:       A program to transcode DVDs and other sources to MPEG-4
+Group:         Applications/Multimedia
+
+%package cli
+Summary:       A program to transcode DVDs and other sources to MPEG-4
+Group:         Applications/Multimedia
+
+%description gui
+HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded 
+transcoder, available for MacOS X, Linux and Windows.
+
+%description cli
+HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded 
+transcoder, available for MacOS X, Linux and Windows.
 
 %prep
-%setup -q
+%setup -n %{name}-%{version} -D -T
+#%setup -q
+#cd %{_builddir}/%{name}-%{version}
 
 
 %build
-%configure
-jam
+#./configure --prefix=%{_prefix}
+#make -C build
 
 
 %install
-rm -rf $RPM_BUILD_ROOT
-DESTDIR=$RPM_BUILD_ROOT jam install 
+#rm -rf $RPM_BUILD_ROOT
+#make -C build PREFIX=$RPM_BUILD_ROOT PREFIX/=$RPM_BUILD_ROOT/ install
 
 ## blow away stuff we don't want
 /bin/rm $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/icon-theme.cache
@@ -34,28 +57,29 @@ DESTDIR=$RPM_BUILD_ROOT jam install
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
+%post gui
 touch --no-create %{_datadir}/icons/hicolor
 if [ -x /usr/bin/gtk-update-icon-cache ]; then
   gtk-update-icon-cache -q %{_datadir}/icons/hicolor
 fi
 
-%postun
-/sbin/ldconfig
+%postun gui
 touch --no-create %{_datadir}/icons/hicolor
 if [ -x /usr/bin/gtk-update-icon-cache ]; then
   gtk-update-icon-cache -q %{_datadir}/icons/hicolor
 fi
 
-%files
+%files gui
 %defattr(-,root,root,-)
-%doc %{_datadir}/doc
-%{_datadir}/ghb
+%doc NEWS AUTHORS CREDITS THANKS COPYING
 %{_datadir}/icons
-%{_datadir}/locale
 %{_datadir}/applications
-%{_bindir}
+%{_bindir}/ghb
 
+%files cli
+%defattr(-,root,root,-)
+%doc NEWS AUTHORS CREDITS THANKS COPYING
+%{_bindir}/HandBrakeCLI
 
 %changelog
 * Sat May 31 2008 John Stebbins <jstebbins@jetheaddev.com> 
index d909ef4..b2a3fb9 100644 (file)
@@ -1,5 +1,4 @@
 /usr/share/icons
-/usr/share/doc/ghb
 /usr/bin/
 /usr/share/applications
 
index 620b0db..21f11a3 100644 (file)
@@ -1,5 +1,4 @@
 usr/bin/ghb
 usr/share/applications/*
-usr/share/doc/ghb/*
 usr/share/icons/*
 #DOCS#
index 7606aed..1af0e01 100644 (file)
@@ -1,4 +1,5 @@
 PKG.deb.machine = `dpkg --print-architecture`
+PKG.rpm.machine = `rpm -E "%_build_arch"`
 PKG.debian  = $(PKG.in/)linux/debian
 PKG.cli.deb = $(PKG.out/)$(HB.name)-$(HB.version)-Ubuntu_CLI_$(BUILD.machine).deb
 PKG.gui.deb = $(PKG.out/)$(HB.name)-$(HB.version)-Ubuntu_GUI_$(BUILD.machine).deb
@@ -6,7 +7,16 @@ PKG.gui.deb = $(PKG.out/)$(HB.name)-$(HB.version)-Ubuntu_GUI_$(BUILD.machine).de
 PKG.cli.tmp.deb = $(PKG.out/)handbrake-cli_$(HB.version)_$(PKG.deb.machine).deb
 PKG.gui.tmp.deb = $(PKG.out/)handbrake-gtk_$(HB.version)_$(PKG.deb.machine).deb
 
+PKG.cli.rpm  = $(PKG.out/)$(HB.name)-$(HB.version)-Fedora_CLI_$(BUILD.machine).rpm
+PKG.gui.rpm  = $(PKG.out/)$(HB.name)-$(HB.version)-Fedora_GUI_$(BUILD.machine).rpm
+RPM.out  = $(STAGE.out/)rpm
+RPM.out/ = $(STAGE.out/)rpm/
+RPMROOT.out  = $(PWD)/$(STAGE.out/)rpmroot
+RPMROOT.out/ = $(PWD)/$(STAGE.out/)rpmroot/
+
 ###############################################################################
 
 BUILD.out += $(PKG.cli.deb)
 BUILD.out += $(PKG.gui.deb)
+BUILD.out += $(PKG.cli.rpm)
+BUILD.out += $(PKG.gui.rpm)
index 60a4cdf..676d7a7 100644 (file)
@@ -1,15 +1,32 @@
-pkg.create:: $(PKG.cli.deb) $(PKG.gui.deb)
+pkg.create.deb:: pkg.create $(PKG.gui.deb) $(PKG.cli.deb)
+pkg.create.rpm:: pkg.create $(PKG.gui.rpm) $(PKG.cli.rpm)
 
+$(PKG.rpm): | $(dir $(PKG.rpm))
+$(PKG.gui.rpm) $(PKG.cli.rpm):
+       -$(MKDIR.exe) -p $(RPM.out/)SOURCES
+       -$(MKDIR.exe) -p $(RPM.out/)SPECS
+       -$(MKDIR.exe) -p $(RPM.out/)BUILD
+       -$(MKDIR.exe) -p $(RPM.out/)RPMS
+       -$(MKDIR.exe) -p $(RPM.out/)SRPMS
+       -$(MKDIR.exe) -p $(RPMROOT.out/)
+       $(CP.exe) $(GTK.src/)ghb.spec $(RPM.out/)SPECS
+       $(CP.exe) $(PKG.src.tar.bz2) $(RPM.out/)SOURCES
+       $(TAR.exe) -xf $(PKG.src.tar.bz2) -C $(RPM.out/)BUILD
+       fakeroot $(MAKE) PREFIX=$(RPMROOT.out/)usr PREFIX/=$(RPMROOT.out/)usr/ install
+       rpmbuild --define="version $(HB.version)" --define="_topdir $(PWD)/$(RPM.out)" --buildroot $(RPMROOT.out) -ba $(GTK.src/)ghb.spec
+       $(CP.exe) $(RPM.out/)RPMS/$(PKG.rpm.machine)/$(HB.name)-cli-$(HB.version)*.rpm $(PKG.cli.rpm)
+       $(CP.exe) $(RPM.out/)RPMS/$(PKG.rpm.machine)/$(HB.name)-gui-$(HB.version)*.rpm $(PKG.gui.rpm)
 
-$(PKG.cli.deb): | $(dir $(PKG.cli.deb))
-$(PKG.gui.deb) $(PKG.cli.deb):
+$(PKG.gui.deb): | $(dir $(PKG.gui.deb))
+$(PKG.gui.deb):
        -rm $(BUILD/)debian
        ln -s $(PKG.debian) $(BUILD/)debian
        fakeroot $(MAKE) -f debian/rules clean
        $(MAKE) BUILDDIR=$(BUILD) CONFIGURE=$(SRC/)configure -f debian/rules build
        echo $(PKG.out/)
        fakeroot $(MAKE) FORCEVERSION="-- -v$(HB.version)" BUILDDIR=$(BUILD) CONFIGURE=$(SRC/)configure PKGDESTDIR=$(PKG.out/) -f debian/rules binary
+       $(MV.exe) $(PKG.gui.tmp.deb) $(PKG.gui.deb)
 
+$(PKG.cli.deb): $(PKG.gui.deb)
        $(MV.exe) $(PKG.cli.tmp.deb) $(PKG.cli.deb)
-       $(MV.exe) $(PKG.gui.tmp.deb) $(PKG.gui.deb)