diff mbox series

[bug#51015,v3] gnu: Add Random Identity Generator (rig)

Message ID PU1PR01MB21551531EBEAB287FE8EA16C8DB69@PU1PR01MB2155.apcprd01.prod.exchangelabs.com
State Accepted
Headers show
Series [bug#51015,v3] gnu: Add Random Identity Generator (rig) | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Foo Chuan Wei Oct. 12, 2021, 9:12 a.m. UTC
* gnu/packages/shellutils.scm (rig): New variable.
---
 gnu/packages/patches/rig-makefile.patch | 27 ++++++++++++++++++
 gnu/packages/shellutils.scm             | 38 +++++++++++++++++++++++++
 2 files changed, 65 insertions(+)
 create mode 100644 gnu/packages/patches/rig-makefile.patch


base-commit: 35aaf1fe10488ae9ed732fb2c383d09a70c109c0

Comments

Ludovic Courtès Oct. 26, 2021, 10:43 a.m. UTC | #1
Hi,

Foo Chuan Wei <chuanwei.foo@hotmail.com> skribis:

> * gnu/packages/shellutils.scm (rig): New variable.

[...]

> + install: rig rig.6
> +-	install -g 0 -m 755 -o 0 -s rig $(BINDIR)
> +-	install -g 0 -m 644 -o 0 rig.6 $(MANDIR)/man6/rig.6
> +-	install -g 0 -m 755 -o 0 -d $(DATADIR)
> +-	install -g 0 -m 644 -o 0 data/*.idx $(DATADIR)
> ++	install -m 755 -d $(DESTDIR)$(BINDIR)
> ++	install -m 755 -d $(DESTDIR)$(DATADIR)

As Liliana wrote regarding PREFIX, please use ‘substitute*’ instead of a
patch to modify these bits.

Could you send an updated patch?

With this change in place, the patch will be ready to go!

Thanks,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/patches/rig-makefile.patch b/gnu/packages/patches/rig-makefile.patch
new file mode 100644
index 0000000000..24cc1c5810
--- /dev/null
+++ b/gnu/packages/patches/rig-makefile.patch
@@ -0,0 +1,27 @@ 
+diff -ur rig-1.11-orig/Makefile rig-1.11/Makefile
+--- rig-1.11-orig/Makefile
++++ rig-1.11/Makefile
+@@ -5,16 +5,18 @@
+ 
+ all: rig rig.6
+ rig: rig.cc
+-	g++ -g rig.cc -o rig -Wall -DDATADIR="\"$(DATADIR)\""
++	${CXX} -O2 -g rig.cc -o rig -Wall -DDATADIR="\"$(DATADIR)\""
+ 
+ rig.6: rig.6.in
+ 	sed s@DATADIR@"$(DATADIR)"@g < rig.6.in > rig.6
+ 
+ install: rig rig.6
+-	install -g 0 -m 755 -o 0 -s rig $(BINDIR)
+-	install -g 0 -m 644 -o 0 rig.6 $(MANDIR)/man6/rig.6
+-	install -g 0 -m 755 -o 0 -d $(DATADIR)
+-	install -g 0 -m 644 -o 0 data/*.idx $(DATADIR)
++	install -m 755 -d $(DESTDIR)$(BINDIR)
++	install -m 755 -d $(DESTDIR)$(DATADIR)
++	install -m 755 -d $(DESTDIR)$(MANDIR)/man6/
++	install -m 755 rig $(DESTDIR)$(BINDIR)/rig
++	install -m 644 data/*.idx $(DESTDIR)$(DATADIR)
++	install -m 644 rig.6 $(DESTDIR)$(MANDIR)/man6/rig.6
+ 
+ clean:
+ 	rm -rf *~ *.rej *.orig *.o rig rig.6
diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index 94b5536df7..1a1b35d48b 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -35,6 +35,7 @@ 
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system python)
+  #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
@@ -398,3 +399,40 @@  the UNIX philosophy, these commands are designed to be composed via pipes. A
 large collection of functions such as basename, replace, contains or is_dir
 are provided as arguments to these commands.")
     (license license:expat)))
+
+(define-public rig
+  (package
+    (name "rig")
+    (version "1.11")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/rig/rig/"
+                                  version "/rig-"
+                                  version ".tar.gz"))
+              (sha256
+                (base32
+                  "1f3snysjqqlpk2kgvm5p2icrj4lsdymccmn3igkc2f60smqckgq0"))
+              (patches (search-patches "rig-makefile.patch"))))
+    (build-system gnu-build-system)
+    (arguments `(#:make-flags
+                 (list (string-append "CXX=" ,(cxx-for-target))
+                       (string-append "PREFIX=" %output))
+                 #:phases
+                 (modify-phases %standard-phases
+                   (delete 'configure)
+                   (add-after 'unpack 'fix-build
+                     (lambda _
+                       (substitute* "rig.cc"
+                         (("^#include <string>")
+                          "#include <cstring>"))
+                       #t)))
+                 #:tests? #f))
+    (home-page "http://rig.sourceforge.net")
+    (synopsis "Random identity generator")
+    (description
+      "RIG (Random Identity Generator) generates random, yet real-looking,
+personal data. It is useful if you need to feed a name to a Web site, BBS, or
+real person, and are too lazy to think of one yourself. Also, if the Web
+site/BBS/person you are giving the information to tries to cross-check the
+city, state, zip, or area code, it will check out.")
+    (license license:gpl2+)))