aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChmouel Boudjnah <chmouel@mandriva.org>2000-07-22 19:45:07 +0000
committerChmouel Boudjnah <chmouel@mandriva.org>2000-07-22 19:45:07 +0000
commitf4845450b04de18b9a5080d960c2f02657d3481f (patch)
tree4b9864281352b8cb4ff05c68c240e8942b015c55
parent8c0cc50f65b62f966b79ca650868dee65b18b095 (diff)
downloadspec-helper-f4845450b04de18b9a5080d960c2f02657d3481f.tar
spec-helper-f4845450b04de18b9a5080d960c2f02657d3481f.tar.gz
spec-helper-f4845450b04de18b9a5080d960c2f02657d3481f.tar.bz2
spec-helper-f4845450b04de18b9a5080d960c2f02657d3481f.tar.xz
spec-helper-f4845450b04de18b9a5080d960c2f02657d3481f.zip
Add the -o option to only process docdir and mandir
-rw-r--r--macroszification20
1 files changed, 18 insertions, 2 deletions
diff --git a/macroszification b/macroszification
index 99909be..5ca1cf5 100644
--- a/macroszification
+++ b/macroszification
@@ -1,16 +1,17 @@
#!/bin/bash
# -*- Mode: shell-script -*-
-# Copyright (C) 2000 by Chmouel Boudjnah <chmouel@mandrakesoft.com>
+# Copyright (C) 2000 by Chmouel Boudjnah <chmouel@mandrakesoft.com>,
+# MandrakeSoft
# Redistribution of this file is permitted under the terms of the GNU
# Public License (GPL)
## description:
# Macroszification of files to be mandrake compliant, also do some check.
-
function usage () {
rval=$1
echo "Usage: $(basename $0) -d --help --nodiff --nocheck --clean SPEC-FILE"
echo -e "\t-d: Product only a diff don't change nothing"
+ echo -e '\t-o: Only change the mandir/infodir'
echo -e "\t--nocheck: Don't try do check about Prefix %configure"
echo -e "\t--clean: remove the old files after"
echo -e "\t--nodiff: I don't want to see the diff output"
@@ -23,6 +24,10 @@ while [[ $1 == -* ]];do
only_diff=1;
shift;
;;
+ -o)
+ only_fhs=1;
+ shift;
+ ;;
--nocheck)
nocheck=1;
shift;
@@ -61,6 +66,8 @@ egrep -q "^%configure" $file && {
}
mv -f $file $file.old
+
+if [[ -z $only_fhs ]];then
cat $file.old | perl -e "
while (<>) {
s@[/]?(usr|%{[_]?prefix})/bin@%{_bindir}@g;
@@ -76,6 +83,15 @@ while (<>) {
print;
}
" > $file
+else
+cat $file.old | perl -e "
+while (<>) {
+ s@[/]?(usr|%{[_]?prefix})/man@%{_mandir}@g;
+ s@[/]?(usr|%{[_]?prefix})/info@%{_infodir}@g;
+ print;
+}
+" > $file
+fi
if [[ -z $nodiff ]];then
diff -u $file.old $file