File: generate.sh

package info (click to toggle)
gworkspace 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 20,832 kB
  • sloc: objc: 69,382; sh: 488; makefile: 39
file content (164 lines) | stat: -rwxr-xr-x 6,533 bytes parent folder | download | duplicates (2)
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/bin/sh
base_dir=`pwd`
g_app="debian/gworkspace.app"
GNUSTEP_SYSTEM_APPS="usr/lib/GNUstep/Applications"
GNUSTEP_SYSTEM_BUNDLES="usr/lib/GNUstep/Bundles"
GNUSTEP_SYSTEM_FRAMEWORKS="usr/lib/GNUstep/Frameworks"
GNUSTEP_SYSTEM_SERVICES="usr/lib/GNUstep/Services"
usrshare="usr/share/GNUstep"
usrinclude="usr/include/GNUstep"

cat <<EOF >$base_dir/debian/gworkspace.app.install.temp
debian/GWorkspace.desktop	/usr/share/applications
GWorkspace.xpm		usr/share/pixmaps
usr/bin/GWorkspace
usr/bin/Recycler
usr/bin/ddbd
usr/bin/fswatcher
usr/bin/lsf*
usr/bin/resizer
usr/bin/search*
usr/bin/wopen
usr/include
usr/lib/lib*
EOF

cat <<EOF >$base_dir/debian/mdfinder.app.install.temp
MDFinder.xpm		usr/share/pixmaps
usr/bin/MDFinder
usr/bin/gmds
usr/bin/md*
EOF


rm -f $base_dir/debian/gworkspace-common.install.temp
rm -f $base_dir/debian/gworkspace.app.links.temp
rm -f $base_dir/debian/mdfinder.app.links.temp
rm -f $base_dir/debian/mdfinder.app.maintscript.temp
rm -f $base_dir/debian/gworkspace.app.maintscript.temp
rm -f $base_dir/debian/mdfinder.app.maintscript.temp

append()
{
  arch_dep_package="$base_dir/debian/$1.app"
  arch_indep_package="$base_dir/debian/$1-common"
  tmp_dir=$base_dir/debian/tmp
  usrlib=$2
  args=$3
  for dir in `ls -A --color=never $args $tmp_dir/$usrlib`
  do
    (echo "$usrlib/$dir/Resources/*\t$usrshare/$dir") >>$arch_indep_package.install.temp
    (echo "$usrshare/$dir\t $usrlib/$dir/Resources") >>$arch_dep_package.links.temp
    (echo "dir_to_symlink\t/$usrlib/$dir/Resources\t/$usrshare/$dir\t0.9.3-1~") >>$arch_dep_package.maintscript.temp
    for i in `ls -A --color=never --ignore="Resources" --ignore="stamp.make" $tmp_dir/$usrlib/$dir`
    do
      (echo "$usrlib/$dir/$i") >>$arch_dep_package.install.temp
    done
  done
  
}

append_for_frameworks()
{
    for i in `ls -A --color=never $base_dir/debian/tmp/$1`
    do
	if [ $i = Resources ]
	then
	    str=`echo $1 | cut -d/ -f5`
	    (echo "$usrshare/Frameworks/$str\t$1/$i") >>$base_dir/debian/gworkspace.app.links.temp
	    (echo "$1/$i/*\t$usrshare/Frameworks/$str") >>$base_dir/debian/gworkspace-common.install.temp
	    (echo "dir_to_symlink\t/$1/$i\t/$usrshare/Frameworks/$str\t0.9.3-1~") >>$base_dir/debian/gworkspace.app.maintscript.temp
	elif test -L $base_dir/debian/tmp/$1/$i
	then
	    (echo $1/$i) >>$base_dir/debian/gworkspace.app.install.temp
	elif [ $i = Headers ]
	then
	    str=`echo $1 | cut -d/ -f5`
	    version=`echo $1 | cut -d/ -f7`
	    (echo "$usrinclude/Frameworks/$str/Versions/$version\t$1/$i") >>$base_dir/debian/gworkspace.app.links.temp
	    (echo "$1/$i/*\t$usrinclude/Frameworks/$str/Versions/$version") >>$base_dir/debian/gworkspace.app.install.temp
	    (echo "dir_to_symlink\t/$1/$i\t/$usrinclude/Frameworks/$str/Versions/$version\t0.9.3-1~") >>$base_dir/debian/gworkspace.app.maintscript.temp
	elif test -f $base_dir/debian/tmp/$1/$i
	then
	    (echo $1/$i) >>$base_dir/debian/gworkspace.app.install.temp
	elif test -d $base_dir/debian/tmp/$1/$i
	then
	    append_for_frameworks $1/$i
	fi
    done
}

# 1 - Install all Resources dirs to /usr/share/GNUstep in gwokspace-common package
#     and symlink them from /usr/lib/GNUstep subdirs,
#     move Header files to /usr/include/ and symlink then from /usr/lib/GNUstep subdirs,
#      install other files in /usr/lib/GNUstep subdirs.

# 1.1 - Applications except MDFinder.app
append gworkspace $GNUSTEP_SYSTEM_APPS "--ignore=MDFinder.app"

# 1.2 - Bundles except Extractors and MDIndexing 
append gworkspace $GNUSTEP_SYSTEM_BUNDLES "--ignore=*.extr --ignore=MDIndexing.prefPane"

#1.3 - Services
append gworkspace $GNUSTEP_SYSTEM_SERVICES

# 1.4 - Frameworks
append_for_frameworks $GNUSTEP_SYSTEM_FRAMEWORKS


# 2 - Same job for mdfinder.app

# 2.1 - Application
for dir in "MDFinder.app"
do
    (echo "$GNUSTEP_SYSTEM_APPS/$dir/Resources/*\t$usrshare/$dir") >>$base_dir/debian/mdfinder.app.install.temp
    (echo "$usrshare/$dir\t $GNUSTEP_SYSTEM_APPS/$dir/Resources") >>$base_dir/debian/mdfinder.app.links.temp
    (echo "dir_to_symlink\t/$GNUSTEP_SYSTEM_APPS/$dir/Resources\t/$usrshare/$dir\t0.9.3-1~") >>$base_dir/debian/mdfinder.app.maintscript.temp
    for j in `ls -A --color=never --ignore="Resources" --ignore="stamp.make" $base_dir/debian/tmp/$GNUSTEP_SYSTEM_APPS/$dir`
    do
	(echo "$GNUSTEP_SYSTEM_APPS/$dir/$j") >>$base_dir/debian/mdfinder.app.install.temp
    done
done



# 2.2 - Bundles

# 2.2.1 - PrefPanes
for dir in `ls -A --color=never $base_dir/debian/tmp/$GNUSTEP_SYSTEM_BUNDLES/`
do
    case $dir in
	*prefPane)
	    (echo "$GNUSTEP_SYSTEM_BUNDLES/$dir/Resources/*\t$usrshare/$dir") >>$base_dir/debian/mdfinder.app.install.temp
	    (echo "$usrshare/$dir\t $GNUSTEP_SYSTEM_BUNDLES/$dir/Resources") >>$base_dir/debian/mdfinder.app.links.temp
	    (echo "dir_to_symlink\t/$GNUSTEP_SYSTEM_BUNDLES/$dir/Resources\t/$usrshare/$dir\t0.9.3-1~") >>$base_dir/debian/mdfinder.app.maintscript.temp
	    for file in `ls -A --color=never --ignore="Resources" --ignore="stamp.make" $base_dir/debian/tmp/$GNUSTEP_SYSTEM_BUNDLES/$dir`
	    do
		(echo "$GNUSTEP_SYSTEM_BUNDLES/$dir/$file") >>$base_dir/debian/mdfinder.app.install.temp
	    done
	    ;;
    esac
done

# 2.2.2 - Extractors
for dir in `ls -A --color=never $base_dir/debian/tmp/$GNUSTEP_SYSTEM_BUNDLES/`
do
    case $dir in
	*extr)
	    (echo "$GNUSTEP_SYSTEM_BUNDLES/$dir/Resources/*\t$usrshare/$dir") >>$base_dir/debian/mdfinder.app.install.temp
	    (echo "$usrshare/$dir\t $GNUSTEP_SYSTEM_BUNDLES/$dir/Resources") >>$base_dir/debian/mdfinder.app.links.temp
	    (echo "dir_to_symlink\t/$GNUSTEP_SYSTEM_BUNDLES/$dir/Resources\t/$usrshare/$dir\t0.9.3-1~") >>$base_dir/debian/mdfinder.app.maintscript.temp
	    for j in `ls -A --color=never --ignore="Resources" --ignore="stamp.make" $base_dir/debian/tmp/$GNUSTEP_SYSTEM_BUNDLES/$dir`
	    do
		(echo "$GNUSTEP_SYSTEM_BUNDLES/$dir/$j") >>$base_dir/debian/mdfinder.app.install.temp
	    done
    esac
done

mv $base_dir/debian/gworkspace-common.install.temp	$base_dir/debian/gworkspace-common.install
mv $base_dir/debian/gworkspace.app.install.temp		$base_dir/debian/gworkspace.app.install
mv $base_dir/debian/gworkspace.app.links.temp		$base_dir/debian/gworkspace.app.links
mv $base_dir/debian/gworkspace.app.maintscript.temp	$base_dir/debian/gworkspace.app.maintscript
mv $base_dir/debian/mdfinder.app.maintscript.temp	$base_dir/debian/mdfinder.app.maintscript
mv $base_dir/debian/mdfinder.app.install.temp		$base_dir/debian/mdfinder.app.install
mv $base_dir/debian/mdfinder.app.links.temp		$base_dir/debian/mdfinder.app.links