Skip to content

Commit

Permalink
LinGui: improved rpm building
Browse files Browse the repository at this point in the history
Resulting rpms have fewer warnings and no errors according to rpmlint.
No need to pre-build binaries.  Just configure and "make pkg.create.rpm"

Standard fedora rpms can be found in:
build/stage/rpm/RPMS and SRPMS

Binary packages are renamed according to handbrake naming convention in:
build/pkg



git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3220 b64f7644-9d1e-0410-96f1-a4d463321fa5
  • Loading branch information
jstebbins committed Apr 12, 2010
1 parent 1a46633 commit 788762e
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 32 deletions.
41 changes: 19 additions & 22 deletions gtk/ghb.spec
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
%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
License: GPLv2
URL: http://handbrake.fr/
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, webkitgtk, gstreamer
Requires: gstreamer-plugins-base
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: glib2-devel, gtk2-devel, hal-devel, webkitgtk-devel
BuildRequires: gstreamer-devel, gstreamer-plugins-base-devel
Requires: gtk2, coreutils

%define debug_package %{nil}

%description
HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded
HandBrake is an open-source, GPL-licensed, multi-platform, multi-threaded
transcoder, available for MacOS X, Linux and Windows.

%package gui
Expand All @@ -29,34 +29,31 @@ 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
HandBrake is an open-source, GPL-licensed, multi-platform, multi-threaded
transcoder, available for MacOS X, Linux and Windows.

%description cli
HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded
HandBrake is an open-source, GPL-licensed, multi-platform, multi-threaded
transcoder, available for MacOS X, Linux and Windows.

%prep
%setup -n %{name}-%{version} -D -T
#%setup -q
#cd %{_builddir}/%{name}-%{version}
%setup -q
cd %{_builddir}/%{name}-%{version}


%build
#./configure --prefix=%{_prefix}
#make -C build
./configure --debug=std --prefix=%{_prefix}
make %{?_smp_mflags} -C build


%install
#rm -rf $RPM_BUILD_ROOT
# I don't want to rebuild the world, so just install what I've prebuilt
make -C $RPM_BUILD_ROOT/../.. DESTDIR=$RPM_BUILD_ROOT install
make -C build DESTDIR=$RPM_BUILD_ROOT install-strip

## blow away stuff we don't want
/bin/rm -f $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/icon-theme.cache

%clean
rm -rf $RPM_BUILD_ROOT
rm -rf %{buildroot}

%post gui
touch --no-create %{_datadir}/icons/hicolor
Expand All @@ -73,7 +70,7 @@ fi
%files gui
%defattr(-,root,root,-)
%doc NEWS AUTHORS CREDITS THANKS COPYING
%{_datadir}/icons
%{_datadir}/icons/hicolor
%{_datadir}/applications
%{_bindir}/ghb

Expand All @@ -83,7 +80,7 @@ fi
%{_bindir}/HandBrakeCLI

%changelog
* Sat May 31 2008 John Stebbins <[email protected]>
- Initial release
* Sun Apr 11 2010 John Stebbins <[email protected]> - svn
- Snapshot release


4 changes: 4 additions & 0 deletions gtk/module.rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ $(eval $(call import.MODULE.rules,GTK))

build: hgtk.build gtk.build
install: gtk.install
install-strip: gtk.install-strip
uninstall: gtk.uninstall
clean: hgtk.clean gtk.clean
xclean: hgtk.clean gtk.xclean
Expand Down Expand Up @@ -34,6 +35,9 @@ gtk.build: | $(GTK.build/)
gtk.build: $(GTK.CONFIGURE.stamp) $(LIBHB.a)
+$(MAKE) -C $(GTK.build/)

gtk.install-strip:
$(MAKE) -C $(GTK.build/) prefix=$(PREFIX) install-strip

gtk.install:
$(MAKE) -C $(GTK.build/) prefix=$(PREFIX) install

Expand Down
1 change: 1 addition & 0 deletions make/include/main.rules
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ endif
build:
clean:
install:
install-strip:
uninstall:
xclean: contrib.xclean clean
doc:
Expand Down
11 changes: 11 additions & 0 deletions pkg/linux/module.defs
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
PKG.deb.machine = `dpkg --print-architecture`
PKG.rpm.machine = `rpm -E "%_target_cpu"`
PKG.release = 1
PKG.rpm.dist = `rpm -E "%dist"`

PKG.rpm.src.tar.bz2 = $(STAGE.out.src/)rpm/$(PKG.basename).tar.bz2
STAGE.out.rpm.src/ = $(STAGE.out.src/)rpm/

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

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.native.rpm.stamp = $(RPM.out/).rpm.stamp

PKG.gui.native.rpm = $(RPM.out/)RPMS/$(PKG.rpm.machine)/$(HB.name)-gui-$(HB.version)-$(PKG.release)$(PKG.rpm.dist).$(PKG.rpm.machine).rpm
PKG.cli.native.rpm = $(RPM.out/)RPMS/$(PKG.rpm.machine)/$(HB.name)-cli-$(HB.version)-$(PKG.release)$(PKG.rpm.dist).$(PKG.rpm.machine).rpm

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
Expand Down
35 changes: 25 additions & 10 deletions pkg/linux/module.rules
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
pkg.create.deb:: pkg.create $(PKG.gui.deb) $(PKG.cli.deb)
pkg.create.rpm:: pkg.create $(PKG.gui.rpm) $(PKG.cli.rpm)
pkg.create.deb:: $(PKG.gui.deb) $(PKG.cli.deb)
pkg.create.rpm:: $(PKG.gui.rpm)

$(PKG.gui.rpm) $(PKG.cli.rpm): | $(dir $(PKG.gui.rpm) $(PKG.cli.rpm))
$(PKG.gui.rpm) $(PKG.cli.rpm):
$(PKG.rpm.src.tar.bz2): | $(STAGE.out.rpm.src/)
$(TAR.exe) cjf $@ -C $(STAGE.out.rpm.src/) $(PKG.basename)

$(STAGE.out.rpm.src/):
# -$(MKDIR.exe) -p $(STAGE.out.rpm.src/)$(PKG.basename)
# tar c --exclude build ../* | tar x -C $(STAGE.out.rpm.src/)$(PKG.basename)
svn co -r$(HB.repo.rev) $(HB.repo.url) $@/$(PKG.basename)
-$(MKDIR.exe) $(STAGE.out.rpm.src/)$(PKG.basename)/download
$(CP.exe) $(SRC/)download/*.tar.* $(STAGE.out.rpm.src/)$(PKG.basename)/download

$(PKG.native.rpm.stamp): $(PKG.rpm.src.tar.bz2)
-$(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
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)
echo "%define name $(HB.name)" > $(RPM.out/)SPECS/ghb.spec
echo "%define release 1" >> $(RPM.out/)SPECS/ghb.spec
echo "%define version $(HB.version)" >> $(RPM.out/)SPECS/ghb.spec
cat $(GTK.src/)ghb.spec >> $(RPM.out/)SPECS/ghb.spec
$(CP.exe) $(PKG.rpm.src.tar.bz2) $(RPM.out/)SOURCES
rpmbuild --define="_topdir $(PWD)/$(RPM.out)" --buildroot $(RPMROOT.out) -ba $(RPM.out/)SPECS/ghb.spec
$(TOUCH.exe) $(PKG.native.rpm.stamp)

$(PKG.gui.rpm): | $(dir $(PKG.gui.rpm))
$(PKG.gui.rpm): $(PKG.native.rpm.stamp)
$(CP.exe) $(PKG.gui.native.rpm) $(PKG.gui.rpm)
$(CP.exe) $(PKG.cli.native.rpm) $(PKG.cli.rpm)

$(PKG.gui.deb): | $(dir $(PKG.gui.deb))
$(PKG.gui.deb):
Expand Down
5 changes: 5 additions & 0 deletions test/module.rules
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ clean: test.clean
## skip install/uninstall on darwin
ifneq ($(BUILD.system),darwin)

test.install-strip: | $(dir $(TEST.install.exe))
$(CP.exe) $(TEST.exe) $(TEST.install.exe)
$(STRIP.exe) $(TEST.install.exe)

test.install: | $(dir $(TEST.install.exe))
$(CP.exe) $(TEST.exe) $(TEST.install.exe)

test.uninstall:
$(RM.exe) -f $(TEST.install.exe)

install-strip: test.install-strip
install: test.install
uninstall: test.uninstall

Expand Down

0 comments on commit 788762e

Please sign in to comment.