Skip to content

Commit

Permalink
dev-util/txt2regex: Add patch to actually install txt2regex script co…
Browse files Browse the repository at this point in the history
…urtesy of René Rhéaume <[email protected]>. Fixes bug 562856.

Package-Manager: portage-2.2.20.1
Signed-off-by: Patrice Clement <[email protected]>
  • Loading branch information
monsieurp committed Oct 13, 2015
1 parent dbf1c6f commit 9ede820
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 7 deletions.
13 changes: 6 additions & 7 deletions dev-util/txt2regex/files/txt2regex-0.8-disable-nls.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
diff -ur txt2regex-0.8/Makefile txt2regex-0.8.nonls/Makefile
--- txt2regex-0.8/Makefile 2004-09-28 16:04:55 -0500
+++ txt2regex-0.8.nonls/Makefile 2005-05-14 15:28:38 -0500
@@ -80,15 +80,8 @@
--- Makefile.orig 2015-10-13 20:09:55.612486000 +0000
+++ Makefile 2015-10-13 20:11:19.166486000 +0000
@@ -81,15 +81,9 @@
rm -rf $(DISTDIR)

#TODO install man page and README
-install: mo
- @[ -d $(LOCALEDIR) ] || mkdir -p $(LOCALEDIR); \
+install:
+install:
@[ -d $(LOCALEDIR) ] || mkdir -p $(LOCALEDIR); \
[ -d $(BINDIR) ] || mkdir -p $(BINDIR); \
- for pot in `cd $(PODIR) && ls *.mo`; do \
- poti=`echo $$pot | sed 's/\.mo$$//'`; \
- modir=$(LOCALEDIR)/$$poti/LC_MESSAGES; \
- [ -d $$modir ] || mkdir -p $$modir; \
- install -m644 $(PODIR)/$$pot $$modir/$(NAME).mo; \
- done; \
sed -e '/^TEXTDOMAINDIR=/s,=.*,=$(LOCALEDIR),' \
sed -e '/^TEXTDOMAINDIR=/s,=.*,=$(BLOCALEDIR),' \
-e '/^VERSION=/s/=.*/=$(VERSION)/' $(SHSKEL) > $(BINDIR)/$(NAME) && \
chmod +x $(BINDIR)/$(NAME) && \
21 changes: 21 additions & 0 deletions dev-util/txt2regex/files/txt2regex-0.8-textdomaindir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- Makefile.orig 2015-10-13 19:24:21.799486000 +0000
+++ Makefile 2015-10-13 19:26:05.187486000 +0000
@@ -11,7 +11,8 @@

DESTDIR =
BINDIR = $(DESTDIR)/usr/bin
-LOCALEDIR = $(DESTDIR)/usr/share/locale
+BLOCALEDIR = /usr/share/locale
+LOCALEDIR = $(DESTDIR)$(BLOCALEDIR)
MANDIR = $(DESTDIR)/usr/share/man/man1

TARGET=all
@@ -89,7 +90,7 @@
[ -d $$modir ] || mkdir -p $$modir; \
install -m644 $(PODIR)/$$pot $$modir/$(NAME).mo; \
done; \
- sed -e '/^TEXTDOMAINDIR=/s,=.*,=$(LOCALEDIR),' \
+ sed -e '/^TEXTDOMAINDIR=/s,=.*,=$(BLOCALEDIR),' \
-e '/^VERSION=/s/=.*/=$(VERSION)/' $(SHSKEL) > $(BINDIR)/$(NAME) && \
chmod +x $(BINDIR)/$(NAME) && \
echo "program '$(NAME)' installed. just run $(BINDIR)/$(NAME)"
35 changes: 35 additions & 0 deletions dev-util/txt2regex/txt2regex-0.8-r3.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

inherit eutils

DESCRIPTION="A Regular Expression wizard that converts human sentences to regexs"
HOMEPAGE="http://txt2regex.sourceforge.net/"
SRC_URI="http://txt2regex.sourceforge.net/${P}.tgz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
IUSE="nls cjk"

DEPEND="nls? ( sys-devel/gettext )"
RDEPEND=">=app-shells/bash-2.04"

src_prepare() {
# bug #562856
epatch "${FILESDIR}"/"${P}-textdomaindir.patch"

# bug #93568
use nls || epatch "${FILESDIR}"/"${P}-disable-nls.patch"

use cjk && sed -i -e 's/\xa4/:+:/g' "${S}"/${P}.sh
}

src_install() {
emake install DESTDIR="${D}" MANDIR="${D}"/usr/share/man/man1 install
dodoc Changelog NEWS README README.japanese TODO
newman txt2regex.man txt2regex.6
}

0 comments on commit 9ede820

Please sign in to comment.