transmission/Jamrules

89 lines
2.4 KiB
Plaintext

include config.jam ;
if ! $(DEFINES)
{
Exit "Please run ./configure first." ;
}
VERSION_MAJOR = 0 ;
VERSION_MINOR = 3 ;
# VERSION_STRING = $(VERSION_MAJOR).$(VERSION_MINOR) ;
VERSION_STRING = 0.4-cvs ;
DEFINES += VERSION_MAJOR=$(VERSION_MAJOR)
VERSION_MINOR=$(VERSION_MINOR)
VERSION_STRING=\\\"$(VERSION_STRING)\\\" ;
OPTIM = -O3 ;
RM = rm -Rf ;
if $(OS) = MACOSX
{
# Build universal binaries
CCFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-arch ppc -arch i386 ;
LINKFLAGS += -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
-arch ppc -arch i386 ;
# Use libtool to build static libraries (ar does not handle
# universal binaries)
RANLIB = ;
NOARSCAN = 1 ;
NOARUPDATE = 1 ;
actions Archive
{
libtool -static $(>) -o $(<) ;
}
rule OSXInfoPlist
{
Depends $(1) : $(2) ;
Depends $(1) : Jamrules ;
Clean clean : $(1) ;
}
actions OSXInfoPlist
{
$(RM) $(1)
sed "s/%%VERSION%%/$(VERSION_STRING)/" < $(2) > $(1)
}
rule OSXBundle
{
Depends exe : $(1) ;
Depends $(1) : $(2) ;
Clean clean : $(1) macosx/build ;
}
actions OSXBundle
{
$(RM) $(1) && ( cd macosx && xcodebuild ) && \
mv macosx/build/Debug/Transmission.app $(1)
}
rule OSXPackage
{
Depends $(1) : $(2) ;
Clean clean : $(1) ;
DoOSXPackage $(1) ;
}
actions DoOSXPackage
{
TMP="Transmission $(VERSION_STRING)"
rm -f $(1) "$TMP" && mkdir "$TMP" &&
mkdir "$TMP/Transmission.app" &&
ditto Transmission.app "$TMP/Transmission.app" &&
ditto AUTHORS "$TMP/AUTHORS.txt" &&
ditto LICENSE "$TMP/LICENSE.txt" &&
ditto NEWS "$TMP/NEWS.txt" &&
( echo "[InternetShortcut]"; \
echo "URL=http://transmission.m0k.org/" ) > \
"$TMP/Homepage.url" &&
( echo "[InternetShortcut]"; \
echo "URL=http://transmission.m0k.org/forum/" ) > \
"$TMP/Forums.url" &&
( echo "[InternetShortcut]"; \
echo "URL=http://transmission.m0k.org/contribute.php" ) > \
"$TMP/Contribute.url" &&
hdiutil create -format UDZO -srcfolder "$TMP" $(1) &&
rm -rf "$TMP"
}
}