Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 455824

Summary: www-client/xombrero-1.4.0 - make branding configurable
Product: Gentoo Linux Reporter: M. B. <tomboy64>
Component: Current packagesAssignee: Rafael Martins (RETIRED) <rafaelmartins>
Status: RESOLVED WONTFIX    
Severity: normal CC: tomwij
Priority: Normal Keywords: EBUILD
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: xombrero-1.4.0-r1.ebuild
xombrero-1.4.0-r1.ebuild

Description M. B. 2013-02-06 12:58:10 UTC
Created attachment 338076 [details]
xombrero-1.4.0-r1.ebuild

I updated the ebuild for xombrero 1.4.0 to add the savedconfig use-flag. What it does is to make the hardcoded default startpage user-configurable.



$ diff -Naur xombrero-1.4.0.ebuild xombrero-1.4.0-r1.ebuild 
--- xombrero-1.4.0.ebuild	2013-01-31 04:31:32.000000000 +0100
+++ /usr/portage/local/mine/www-client/xombrero/xombrero-1.4.0-r1.ebuild	2013-02-06 13:42:05.000000000 +0100
@@ -9,7 +9,7 @@
 	GIT_ECLASS=git-2
 fi
 
-inherit eutils fdo-mime toolchain-funcs ${GIT_ECLASS}
+inherit eutils fdo-mime savedconfig toolchain-funcs ${GIT_ECLASS}
 
 DESCRIPTION="A minimalist web browser with sophisticated security features designed-in"
 HOMEPAGE="http://opensource.conformal.com/wiki/xombrero"
@@ -26,7 +26,7 @@
 
 LICENSE="ISC"
 SLOT="0"
-IUSE="examples"
+IUSE="examples savedconfig"
 
 RDEPEND="dev-libs/glib:2
 	dev-libs/libbsd
@@ -52,16 +52,24 @@
 S="${WORKDIR}/${P}/linux"
 
 src_prepare() {
+    echo "# Set your desired start page here.
+# First line not starting with # will be taken; no url check is performed." > ${PN}.conf
+    echo "http://www.gentoo.org" >> ${PN}.conf
+    if use savedconfig; then
+        restore_config ${PN}.conf
+    fi
+
+	url=`grep -v '^#' ${PN}.conf | head -n1`
+	sed -i \
+		-e 's#https://www\.cyphertite\.com#'${url}'#' \
+		-e "s#/usr/local#/usr#" \
+		../xombrero.h || die 'sed ../xombrero.h failed.'
 	sed -i \
 		-e 's/-O2//' \
 		-e 's/-ggdb3//' \
 		-e 's,install: all,install: all\n\tinstall -m 755 -d $(DESTDIR)$(PREFIX)/share/applications,g' \
 		Makefile || die 'sed Makefile failed.'
 	sed -i \
-		-e 's#https://www\.cyphertite\.com#http://www.gentoo.org/#' \
-		-e "s#/usr/local#/usr#" \
-		../xombrero.h || die 'sed ../xombrero.c failed.'
-	sed -i \
 		"s#Icon=#Icon=/usr/share/${PN}/#" \
 		../xombrero.desktop || die 'sed ../xombrero.desktop failed.'
 }
@@ -71,6 +79,8 @@
 }
 
 src_install() {
+	save_config ${PN}.conf
+
 	emake \
 		DESTDIR="${D}" \
 		PREFIX=/usr \
@@ -85,7 +95,14 @@
 	fi
 }
 
+pkg_preinst() {
+	if use savedconfig; then
+        ewarn 'USE=savedconfig is active. Change your start-page manually'
+		ewarn 'in "'${EROOT}etc/portage/savedconfig/${CATEGORY}/${PF}'".'
+    fi
+}
 pkg_postinst() {
+	savedconfig_pkg_postinst
 	fdo-mime_desktop_database_update
 	fdo-mime_mime_database_update
 }
Comment 1 M. B. 2013-02-06 13:06:47 UTC
Created attachment 338084 [details]
xombrero-1.4.0-r1.ebuild

Added a minor sed to prevent build-failure if the user's start-url contains '#'.
Comment 2 Rafael Martins (RETIRED) gentoo-dev 2013-02-06 13:25:19 UTC
I'd recommend sending a patch upstream to allow the configuration of the homepage in the configuration file. Setting home pages in build time is a bad thing anyway.
Comment 3 M. B. 2013-02-07 17:56:52 UTC
I agree. BUT the initial branding is done via the ebuild (to 'http://www.gentoo.org//' (sic!)). The .xombrero.conf already does provide such a means of setting the homepage.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-07-01 09:24:59 UTC
commit a39883d855635a828669996d7fa0fcd722d85db8
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: Sat Jul 1 11:16:03 2017
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: Sat Jul 1 11:20:03 2017

    www-client/xombrero: Remove last-rited pkg, #608626