File: pack

package info (click to toggle)
knetfilter 3.3.1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,832 kB
  • ctags: 1,075
  • sloc: sh: 11,588; cpp: 7,774; perl: 2,721; makefile: 126
file content (120 lines) | stat: -rwxr-xr-x 3,210 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# This is the main script.
# Call it with the package name as argument, like:  ./pack kdelibs
# Make sure to update the version numbers inside the script first.

package=$1

case $package in
  qt-copy)
    version=3.0.3
    ;;
  arts) 
    version=1.0.0
    ;;
  kdevelop)
    version=2.1_for_KDE_3.0
    #version=2.1_for_KDE_2.2
    ;;
  kdoc)
    version=2.0a54
    ;;
  *)
    version=3.0
    ;;
esac

CDPATH=""

test -n "$package" || { echo "requires modulename as parameter"; exit 1; }
test -d clean || { echo "create clean subdir with cvs checkout"; exit 1; }
test -d dirty || { echo "create empty subdir dirty"; exit 1; }
test -d sources || { echo "create empty subdir sources"; exit 1; }

test -d clean/$package || { echo "clean/$package does not exist"; exit 1; }
test -d dirty/$package-$version && { echo "rm -rf dirty/$package-$version"; rm -rf dirty/$package-$version; }
test -d dirty/$package && { echo "rm -rf dirty/$package"; rm -rf dirty/$package; }

echo "cp -pr clean/$package dirty"
cp -pr clean/$package dirty || exit 1
{
  echo "cd dirty"
  cd dirty || exit 1
  if [ $package = "kde-i18n" -o $package = "koffice-i18n" ]; then
  ( cd $package 
    echo Removing non-released languages from package
    test -f subdirs.orig || { echo "$package/subdirs.orig doest no exist"; exit 1; }
    cat subdirs.orig | while read lang; do
       if grep -q ^$lang\$ subdirs; then
          echo Keeping $lang
       else
          echo Deleting $lang
          rm -rf $lang
       fi
    done
    )
  fi
  if [ $package = "koffice-i18n" ]; then
  ( cd $package
     ### koffice release specific
     echo "Removing non-koffice stuff"
     perl -pi -e 's/kde-i18n/koffice-i18n/g; s/kdelibs.po/Makefile.am/g' Makefile.am
     rm -rf templates */data */docs
     cat subdirs | while read lang; do
       ( cd $lang  && \
         mv messages messages.orig && \
	 mkdir messages && \
         mv messages.orig/Makefile.am messages/ &&\
         mv messages.orig/koffice messages/ &&\
	 rm -rf messages.orig)
     done
    #####
  )
  fi
  if [ $package = "kde-i18n" ]; then
  ( cd $package
     echo "Removing other stuff"
     cat subdirs | while read lang; do
       ( cd $lang  && \
	 rm -rf messages/others && \
         rm -rf docs/others )
     done
    #####
  )
  ( cd $package
     echo "Removing koffice specific stuff"
     cat subdirs | while read lang; do
       ( cd $lang  && \
         rm -rf messages/koffice \
         rm -rf docs/koffice )
     done
    #####
  )
  fi
  if [ $package = "koffice" ]; then
  ( cd $package
    ### koffice release specific
     echo "Removing non-released stuff"
    # rm -rf krayon kplato graphite kosoap
    #####
  )
  fi

  # Anonymize the CVS dirs
  echo "anon $package"
  ../anon $package || exit 1

  # Generate docu
  echo "docu $package"
  ../docu $package 

  # Prepare for distribution
  echo "dist $package"
  ../dist $package $version || exit 1

  # Final packaging
  echo "mv $package $package-$version"
  mv $package $package-$version || exit 1
  echo "tar cjf $package-$version.tar.bz2 $package-$version"
  tar --owner=root --group=root -cjf ../sources/$package-$version.tar.bz2 $package-$version || exit 1
}
rm -rf dirty/$package || exit 1