mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
Add lots of comments. Deal with %dir. Deal with duplicate entries.
Properly call regxpcom each time components get installed. Not part of SeaMonkey.
This commit is contained in:
parent
e7dda67036
commit
6e0ce90527
@ -1,4 +1,50 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
#
|
||||
|
||||
# The way this thing works:
|
||||
#
|
||||
# + A packages file is parsed. This file contains something
|
||||
# that looks like this:
|
||||
#
|
||||
# XXX
|
||||
#
|
||||
# + For each package, a list of modules corresponding to that
|
||||
# package is parsed. Each modules corresponds to a
|
||||
# directory somewhere in a mozilla build tree - usually
|
||||
# the toplevel ones (ie, layout, nsprpub, xpcom) but not
|
||||
# always (ie, extensions/wallet)
|
||||
#
|
||||
# + For each module, print-module-filelist.sh is invoked.
|
||||
# The output of that is parsed and converted from the
|
||||
# crazy mozilla install hierarchy to something that
|
||||
# makes sense on a linux box.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# bin/components/libraptorhtml.so
|
||||
#
|
||||
# becomes
|
||||
#
|
||||
# %{prefix}/lib/mozilla/components/libraptorhtml.so
|
||||
#
|
||||
# + Also, this script determines which files belong in
|
||||
# a devel package. For example, "include/*" and "idl/*"
|
||||
|
||||
name=generate-package-info.sh
|
||||
|
||||
@ -61,18 +107,26 @@ do
|
||||
file_list_devel=$outdir/mozilla-$p-devel-file-list.txt
|
||||
|
||||
tmp_raw=/tmp/raw-list.$$.tmp
|
||||
|
||||
tmp_file_list=/tmp/file-list.$$.tmp
|
||||
tmp_file_list_devel=/tmp/file-list-devel.$$.tmp
|
||||
|
||||
tmp_dir_list=/tmp/dir-list.$$.tmp
|
||||
tmp_dir_list_devel=/tmp/dir-list-devel.$$.tmp
|
||||
|
||||
# echo "package=$p"
|
||||
# echo "modules=$modules"
|
||||
# echo "file_list=$file_list"
|
||||
# echo "file_list_devel=$file_list_devel"
|
||||
# echo "#################"
|
||||
|
||||
rm -f $tmp_raw $file_list $file_list_devel $tmp_file_list $tmp_file_list_devel
|
||||
rm -f $tmp_raw $file_list $file_list_devel
|
||||
rm -f $tmp_file_list $tmp_file_list_devel
|
||||
rm -f $tmp_dir_list $tmp_dir_list_devel
|
||||
|
||||
touch $tmp_raw $file_list $file_list_devel $tmp_file_list $tmp_file_list_devel
|
||||
touch $tmp_raw $file_list $file_list_devel
|
||||
touch $tmp_file_list $tmp_file_list_devel
|
||||
touch $tmp_dir_list $tmp_dir_list_devel
|
||||
|
||||
print_cmd=$mozdir/build/package/rpm/print-module-filelist.sh
|
||||
|
||||
@ -94,6 +148,37 @@ do
|
||||
|
||||
case "$prefix"
|
||||
in
|
||||
# dirs
|
||||
DIR:*)
|
||||
dir=`echo $i | cut -b5-`
|
||||
|
||||
case "$dir"
|
||||
in
|
||||
include*)
|
||||
echo $dir >> $tmp_dir_list_devel
|
||||
;;
|
||||
|
||||
*)
|
||||
prefix2=`echo $dir | awk -F"/" '{ print $2; }'`
|
||||
|
||||
case "$prefix2"
|
||||
in
|
||||
# Cut out the "bin/" from these
|
||||
res|chrome|defaults)
|
||||
echo $dir | cut -b5- >> $tmp_dir_list
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
##
|
||||
## XXX: This one needs to be smarter and catch more devel only
|
||||
## stuff. For example, the gecko viewer and all its resources
|
||||
## should go in the devel package. This would in turn make the
|
||||
## regular package smaller.
|
||||
##
|
||||
|
||||
# include, idl, lib
|
||||
include|idl|lib)
|
||||
echo $i >> $tmp_file_list_devel
|
||||
@ -139,9 +224,14 @@ do
|
||||
done
|
||||
|
||||
# Spit out sorted file lists
|
||||
cat $tmp_file_list | sort | awk '{ printf("%%{prefix}/lib/mozilla/%s\n" , $0); }' >> $file_list
|
||||
cat $tmp_file_list_devel | sort | awk '{ printf("%%{prefix}/lib/mozilla/%s\n" , $0); }' >> $file_list_devel
|
||||
cat $tmp_dir_list | sort | uniq | awk '{ printf("%%dir %%{prefix}/lib/mozilla/%s\n" , $0); }' >> $file_list
|
||||
|
||||
cat $tmp_file_list | sort | uniq | awk '{ printf("%%{prefix}/lib/mozilla/%s\n" , $0); }' >> $file_list
|
||||
|
||||
cat $tmp_dir_list_devel | sort | uniq | awk '{ printf("%%dir %%{prefix}/lib/mozilla/%s\n" , $0); }' >> $file_list_devel
|
||||
|
||||
cat $tmp_file_list_devel | sort | uniq | awk '{ printf("%%{prefix}/lib/mozilla/%s\n" , $0); }' >> $file_list_devel
|
||||
|
||||
# Cleanup
|
||||
rm -f $tmp_raw $tmp_file_list $tmp_file_list_devel
|
||||
rm -f $tmp_raw $tmp_file_list $tmp_file_list_devel $tmp_dir_list $tmp_dir_list_devel
|
||||
done
|
||||
|
@ -2,6 +2,7 @@ db
|
||||
xpcom
|
||||
intl
|
||||
js
|
||||
modules/libutil
|
||||
modules/security/freenav
|
||||
modules/libpref
|
||||
modules/libimg
|
||||
|
1
build/package/rpm/mozilla-mailnews-module-list.txt
Normal file
1
build/package/rpm/mozilla-mailnews-module-list.txt
Normal file
@ -0,0 +1 @@
|
||||
mailnews
|
@ -7,3 +7,4 @@ profile
|
||||
xptoolkit
|
||||
cookie
|
||||
wallet
|
||||
mailnews
|
||||
|
@ -7,11 +7,41 @@ Copyright: NPL/MPL
|
||||
Group: Mozilla
|
||||
Source0: ftp://ftp.mozilla.org/pub/mozilla/nightly/latest/mozilla-source.tar.gz
|
||||
#Source0: ftp://ftp.mozilla.org/pub/mozilla/nightly/latest/mozilla-binary.tar.gz
|
||||
Source1: mozilla-run-regxpcom.sh
|
||||
Buildroot: /var/tmp/mozilla-root
|
||||
Prefix: /usr
|
||||
Requires: gtk+ >= 1.2.4
|
||||
|
||||
#
|
||||
# TODO: lots of stuff
|
||||
#
|
||||
# + Add nice summary and description entries
|
||||
#
|
||||
# + Make sure the requires entries make sense
|
||||
#
|
||||
# + Add more packages for other mozilla extensions (for instance: irc)
|
||||
#
|
||||
# + Remove and/or combine the current packages that make more sense
|
||||
#
|
||||
# + mozilla-xpcom package ?
|
||||
#
|
||||
# + should nspr be its own package ?
|
||||
#
|
||||
# + it is probably a good idea to have a mozilla-browser package
|
||||
# instead of mozilla-xptoolkit
|
||||
#
|
||||
# + the mozilla-xpinstall package obviously doesnt make sense -
|
||||
# its there for show
|
||||
#
|
||||
# + a lot of stuff is dumped into the default package that
|
||||
# should really be in the devel package. For example the
|
||||
# gecko viewer and all its tests.
|
||||
#
|
||||
# For the code that determines what goes where, see:
|
||||
#
|
||||
# mozilla/build/package/rpm/print-module-filelist.sh
|
||||
# mozilla/build/package/rpm/generate-package-info.sh
|
||||
#
|
||||
|
||||
#Exclusivearch: i386
|
||||
|
||||
%description
|
||||
@ -168,6 +198,24 @@ Requires: mozilla-layout-devel
|
||||
%description wallet-devel
|
||||
mozilla-wallet devel
|
||||
|
||||
%package mailnews
|
||||
Summary: mozilla-mailnews
|
||||
Group: Mozilla
|
||||
Requires: mozilla-layout
|
||||
|
||||
%description mailnews
|
||||
mozilla-mailnews
|
||||
|
||||
%package mailnews-devel
|
||||
Requires: mozilla-mailnews
|
||||
Summary: mozilla-mailnews-devel
|
||||
Group: Mozilla
|
||||
Requires: mozilla-layout-devel
|
||||
|
||||
%description mailnews-devel
|
||||
mozilla-mailnews devel
|
||||
|
||||
|
||||
%prep
|
||||
%setup -n mozilla
|
||||
|
||||
@ -197,11 +245,12 @@ touch $here/blank
|
||||
MOZCONFIG=blank
|
||||
export MOZCONFIG
|
||||
|
||||
./configure --disable-mailnews --disable-tests --with-xlib=no --with-motif=no --disable-gtk-mozilla
|
||||
./configure --disable-tests --with-xlib=no --with-motif=no --disable-gtk-mozilla
|
||||
|
||||
#./configure --disable-debug --enable-optimize --disable-mailnews --disable-tests --with-xlib=no --with-motif=no --enable-strip-libs --disable-gtk-mozilla
|
||||
|
||||
make
|
||||
make everything
|
||||
|
||||
fi
|
||||
################################
|
||||
|
||||
@ -238,15 +287,27 @@ cd $RPM_BUILD_ROOT/%{prefix}/lib/mozilla/
|
||||
/bin/mv -f bin/netscape.cfg .
|
||||
/bin/mv -f bin/res .
|
||||
|
||||
strip lib/*.so
|
||||
strip components/*.so
|
||||
|
||||
cd $here
|
||||
|
||||
install -m 755 build/package/rpm/mozilla $RPM_BUILD_ROOT/%{prefix}/lib/mozilla/bin
|
||||
|
||||
install -m 755 $RPM_SOURCE_DIR/mozilla-run-regxpcom.sh $RPM_BUILD_ROOT/%{prefix}/lib/mozilla/bin
|
||||
|
||||
touch $RPM_BUILD_ROOT/%{prefix}/lib/mozilla/component.reg
|
||||
################################
|
||||
|
||||
##
|
||||
## This function gets called on the %post stage to make sure any
|
||||
## new components that are installed in the system get
|
||||
## registered to component.reg
|
||||
##
|
||||
call-regxpcom()
|
||||
{
|
||||
here=`pwd`
|
||||
cd %{prefix}/lib/mozilla
|
||||
MOZILLA_FIVE_HOME=`pwd` LD_LIBRARY_PATH=`pwd`/lib ./bin/regxpcom
|
||||
cd $here
|
||||
}
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
@ -258,14 +319,21 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files -f file-lists/mozilla-core-file-list.txt core
|
||||
%defattr(-,root,root)
|
||||
%config(missingok) %{prefix}/lib/mozilla/component.reg
|
||||
%{prefix}/lib/mozilla/bin/mozilla-run-regxpcom.sh %{prefix}/lib/mozilla
|
||||
%dir %{prefix}/lib/mozilla
|
||||
%dir %{prefix}/lib/mozilla/bin
|
||||
%dir %{prefix}/lib/mozilla/chrome
|
||||
%dir %{prefix}/lib/mozilla/components
|
||||
%dir %{prefix}/lib/mozilla/defaults
|
||||
%dir %{prefix}/lib/mozilla/defaults/pref
|
||||
%dir %{prefix}/lib/mozilla/lib
|
||||
%dir %{prefix}/lib/mozilla/plugins
|
||||
%dir %{prefix}/lib/mozilla/res
|
||||
|
||||
%files -f file-lists/mozilla-core-devel-file-list.txt core-devel
|
||||
%defattr(-,root,root)
|
||||
|
||||
%post core
|
||||
%{prefix}/lib/mozilla/bin/mozilla-run-regxpcom.sh %{prefix}/lib/mozilla
|
||||
call-regxpcom
|
||||
|
||||
%files -f file-lists/mozilla-network-file-list.txt network
|
||||
%defattr(-,root,root)
|
||||
@ -274,7 +342,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root)
|
||||
|
||||
%post network
|
||||
%{prefix}/lib/mozilla/bin/mozilla-run-regxpcom.sh %{prefix}/lib/mozilla
|
||||
call-regxpcom
|
||||
|
||||
%files -f file-lists/mozilla-layout-file-list.txt layout
|
||||
%defattr(-,root,root)
|
||||
@ -283,7 +351,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root)
|
||||
|
||||
%post layout
|
||||
%{prefix}/lib/mozilla/bin/mozilla-run-regxpcom.sh %{prefix}/lib/mozilla
|
||||
call-regxpcom
|
||||
|
||||
%files -f file-lists/mozilla-xpinstall-file-list.txt xpinstall
|
||||
%defattr(-,root,root)
|
||||
@ -292,7 +360,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root)
|
||||
|
||||
%post xpinstall
|
||||
%{prefix}/lib/mozilla/bin/mozilla-run-regxpcom.sh %{prefix}/lib/mozilla
|
||||
call-regxpcom
|
||||
|
||||
%files -f file-lists/mozilla-profile-file-list.txt profile
|
||||
%defattr(-,root,root)
|
||||
@ -301,7 +369,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root)
|
||||
|
||||
%post profile
|
||||
%{prefix}/lib/mozilla/bin/mozilla-run-regxpcom.sh %{prefix}/lib/mozilla
|
||||
call-regxpcom
|
||||
|
||||
%files -f file-lists/mozilla-xptoolkit-file-list.txt xptoolkit
|
||||
%defattr(-,root,root)
|
||||
@ -311,7 +379,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root)
|
||||
|
||||
%post xptoolkit
|
||||
%{prefix}/lib/mozilla/bin/mozilla-run-regxpcom.sh %{prefix}/lib/mozilla
|
||||
call-regxpcom
|
||||
|
||||
%files -f file-lists/mozilla-cookie-file-list.txt cookie
|
||||
%defattr(-,root,root)
|
||||
@ -320,7 +388,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root)
|
||||
|
||||
%post cookie
|
||||
%{prefix}/lib/mozilla/bin/mozilla-run-regxpcom.sh %{prefix}/lib/mozilla
|
||||
call-regxpcom
|
||||
|
||||
%files -f file-lists/mozilla-wallet-file-list.txt wallet
|
||||
%defattr(-,root,root)
|
||||
@ -329,7 +397,16 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root)
|
||||
|
||||
%post wallet
|
||||
%{prefix}/lib/mozilla/bin/mozilla-run-regxpcom.sh %{prefix}/lib/mozilla
|
||||
call-regxpcom
|
||||
|
||||
%files -f file-lists/mozilla-mailnews-file-list.txt mailnews
|
||||
%defattr(-,root,root)
|
||||
|
||||
%files -f file-lists/mozilla-mailnews-devel-file-list.txt mailnews-devel
|
||||
%defattr(-,root,root)
|
||||
|
||||
%post mailnews
|
||||
call-regxpcom
|
||||
|
||||
%changelog
|
||||
* Wed Oct 20 1999 Ramiro Estrugo <ramiro@fateware.com>
|
||||
|
@ -17,14 +17,34 @@
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
# The way this thing works:
|
||||
#
|
||||
# + a phony $(DIST) is created: /tmp/foo
|
||||
#
|
||||
# + The module is instaled there so that it can be isolated and
|
||||
# catalogued.
|
||||
#
|
||||
# + A bunch of case statements determine what gets ignored
|
||||
# and what is otherwise echoed as a file or dir member for
|
||||
# the module
|
||||
#
|
||||
# + Most of this hacks are a result of the totally messed
|
||||
# way in which mozilla pretentsto do "make install"
|
||||
|
||||
here=`pwd`
|
||||
|
||||
dist=/tmp/dist-$$.tmp
|
||||
list=/tmp/list-$$.txt
|
||||
list2=/tmp/list2-$$.txt
|
||||
|
||||
rm -rf $dist $list $list2
|
||||
raw_file_list=/tmp/raw-file-list-$$.txt
|
||||
file_list=/tmp/file-list-$$.txt
|
||||
|
||||
raw_dir_list=/tmp/raw-dir-list-$$.txt
|
||||
dir_list=/tmp/dir-list-$$.txt
|
||||
|
||||
rm -rf $dist $raw_file_list $file_list $raw_dir_list $dir_list
|
||||
|
||||
# Need to mkdir include or else "make export" in mozilla gets confused
|
||||
mkdir -p $dist
|
||||
mkdir -p $dist/include
|
||||
|
||||
@ -32,11 +52,12 @@ make -s DIST=$dist XPDIST=$dist PUBLIC=$dist/include EXTRA_DEPS= >/dev/null 2>&1
|
||||
|
||||
cd $dist
|
||||
|
||||
find -type l | cut -b3- > $list
|
||||
find -type l | cut -b3- > $raw_file_list
|
||||
find -type d | cut -b3- | grep -v -e "^[ \t]*$" > $raw_dir_list
|
||||
|
||||
touch $list2
|
||||
touch $file_list
|
||||
|
||||
for i in `cat $list`
|
||||
for i in `cat $raw_file_list`
|
||||
do
|
||||
skip="false"
|
||||
|
||||
@ -84,15 +105,48 @@ do
|
||||
|
||||
if [ "$skip" != "true" ]
|
||||
then
|
||||
echo $i >> $list2
|
||||
echo $i >> $file_list
|
||||
# else
|
||||
# echo "skipping $i"
|
||||
fi
|
||||
done
|
||||
|
||||
cat $list2
|
||||
touch $dir_list
|
||||
|
||||
#rm -rf $dist $list $list2
|
||||
for i in `cat $raw_dir_list`
|
||||
do
|
||||
skip="false"
|
||||
|
||||
# Skip directories that are shared across all of mozilla's components
|
||||
case $i in
|
||||
# level 1
|
||||
include|idl|lib|bin)
|
||||
skip="true"
|
||||
;;
|
||||
|
||||
# level 2
|
||||
lib/components|bin/components|bin/chrome|bin/res|bin/defaults|bin/plugins)
|
||||
skip="true"
|
||||
;;
|
||||
|
||||
# level 3
|
||||
bin/defaults/pref)
|
||||
skip="true"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$skip" != "true" ]
|
||||
then
|
||||
echo DIR:$i >> $dir_list
|
||||
# else
|
||||
# echo "skipping $i"
|
||||
fi
|
||||
done
|
||||
|
||||
cat $file_list
|
||||
cat $dir_list
|
||||
|
||||
rm -rf $dist $raw_file_list $file_list $raw_dir_list $dir_list
|
||||
|
||||
cd $here
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user