Permalink
Browse files

Adapted to create the package with current Mac OS X & Xcode.

  • Loading branch information...
1 parent cf0e43c commit 385594585e66609736778c89523a9413b461e25f @gpz500 gpz500 committed Apr 7, 2016
View
@@ -15,7 +15,7 @@ man1_MANS = fuse-ext2.1
if DARWIN
package:
- $(SHELL) $(top_srcdir)/tools/macosx/make-pkg.sh "$(VERSION)" "$(top_srcdir)" "$(top_builddir)" "$(top_srcdir)/tools/macosx/"
+ $(SHELL) $(top_srcdir)/tools/macosx/make-pkg.sh "$(VERSION)" "$(top_builddir)" "$(top_srcdir)/tools/macosx/"
endif
if LINUX
package:
View
@@ -1,5 +1,5 @@
-AC_INIT([fuse-ext2], [0.0.9], [alper.akcan@gmail.com])
+AC_INIT([fuse-ext2], [0.0.9-gpz500], [alper.akcan@gmail.com])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADER([config.h])
@@ -151,7 +151,8 @@ if DARWIN
install-exec-local:
$(INSTALL) -d "$(DESTDIR)/$(sbindir)"
$(LN_S) -f "/Library/Filesystems/fuse-ext2.fs/Contents/Resources/mount_fuse-ext2" "$(DESTDIR)/$(sbindir)/mount_fuse-ext2"
- $(LN_S) -f "$$(brew --prefix e2fsprogs)/sbin/e2label" "$(DESTDIR)/$(bindir)/e2label"
+ $(LN_S) -f "/usr/local/opt/e2fsprogs/sbin/e2label" "$(DESTDIR)/$(sbindir)/e2label"
+ $(LN_S) -f "/usr/local/opt/e2fsprogs/sbin/mke2fs" "$(DESTDIR)/$(sbindir)/mke2fs"
endif
if LINUX
install-data-hook:
@@ -42,8 +42,8 @@ FSUR_INITRECOGNIZED=-8 # response to FSUC_PROBE or FSUC_PROBEFORINIT, implies th
# Set paths to bundled executables here (omit /usr/local):
FUSE_EXT2=/bin/fuse-ext2
FUSE_EXT2_PROBE=/bin/fuse-ext2.probe
-FUSE_EXT2_MKE2FS=/bin/fuse-ext2.mke2fs
-FUSE_EXT2_E2LABEL=/bin/e2label
+FUSE_EXT2_MKE2FS=/sbin/mke2fs
+FUSE_EXT2_E2LABEL=/sbin/e2label
FUSE_EXT2_WAIT=/bin/fuse-ext2.wait
FUSE_EXT2_DAEMON=/bin/fuse-ext2.daemon
@@ -5,6 +5,9 @@
#!/bin/sh
+# Exit immediately in case of error
+set -e
+
SUDO="sudo"
SED_E="${SUDO} sed -e"
MV="${SUDO} mv"
@@ -14,29 +17,23 @@ MKDIR_P="${SUDO} mkdir -p"
LN_SF="${SUDO} ln -sf"
INSTALL_C="${SUDO} install -c"
CHOWN_R="${SUDO} chown -R"
-PKGMANAGER="${SUDO} /Developer/usr/bin/packagemaker"
-TMP_FOLDER="tmp/"
-DISTRIBUTION_FOLDER="${TMP_FOLDER}/Distribution_folder/"
+PKGBUILD="${SUDO} pkgbuild"
+TMP_FOLDER="$(mktemp -d)"
+DISTRIBUTION_FOLDER="$TMP_FOLDER/Distribution_Folder"
+SETFILE="${SUDO} $(xcode-select -p)/Tools/SetFile"
FUSEEXT2_NAME="fuse-ext2"
FUSEEXT2_VERSION="$1"
-SOURCE_FOLDER="$2"
-BUILD_FOLDER="$3"
-MKPKG_FOLDER="$4"
+BUILD_FOLDER="$2"
+MKPKG_FOLDER="$3"
if [ x"$FUSEEXT2_VERSION" = x"" ]
then
echo "Usage: make-pkg.sh <version> <srcdir> <builddir> <mkpkgdir>"
exit 1
fi
-if [ x"$SOURCE_FOLDER" = x"" ]
-then
- echo "Usage: make-pkg.sh <version> <srcdir> <builddir> <mkpkgdir>"
- exit 1
-fi
-
if [ x"$BUILD_FOLDER" = x"" ]
then
echo "Usage: make-pkg.sh <version> <srcdir> <builddir> <mkpkgdir>"
@@ -49,52 +46,14 @@ then
exit 1
fi
-${RM_RF} ${TMP_FOLDER} *.pkg *.dmg
-${MKDIR_P} ${TMP_FOLDER}
-${MKDIR_P} ${DISTRIBUTION_FOLDER}
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/sbin
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/usr
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/usr/sbin
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/usr/local
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/usr/local/bin
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/usr/local/lib
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/usr/local/lib/pkgconfig
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/usr/local/share/man/man1/
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/Library/PreferencePanes
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/System/Library/Filesystems/fuse-ext2.fs
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/System/Library/Filesystems/fuse-ext2.fs/Support
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/System/Library/Filesystems/fuse-ext2.fs/Contents
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/System/Library/Filesystems/fuse-ext2.fs/Contents/Resources
-${MKDIR_P} ${DISTRIBUTION_FOLDER}/System/Library/Filesystems/fuse-ext2.fs/Contents/Resources/English.lproj
-${CP_R} ${MKPKG_FOLDER}/prefpane/build/Release/fuse-ext2.prefPane ${DISTRIBUTION_FOLDER}/Library/PreferencePanes/fuse-ext2.prefPane
-${INSTALL_C} -m 755 ${BUILD_FOLDER}/e2fsprogs-1.41.9/misc/fuse-ext2.e2label ${DISTRIBUTION_FOLDER}/usr/local/bin/fuse-ext2.e2label
-${INSTALL_C} -m 755 ${BUILD_FOLDER}/e2fsprogs-1.41.9/misc/fuse-ext2.mke2fs ${DISTRIBUTION_FOLDER}/usr/local/bin/fuse-ext2.mke2fs
-${INSTALL_C} -m 755 ${BUILD_FOLDER}/fuse-ext2/fuse-ext2 ${DISTRIBUTION_FOLDER}/usr/local/bin/fuse-ext2
-${INSTALL_C} -m 755 ${BUILD_FOLDER}/fuse-ext2/fuse-ext2.wait ${DISTRIBUTION_FOLDER}/usr/local/bin/fuse-ext2.wait
-${INSTALL_C} -m 755 ${BUILD_FOLDER}/fuse-ext2/fuse-ext2.probe ${DISTRIBUTION_FOLDER}/usr/local/bin/fuse-ext2.probe
-${INSTALL_C} -m 755 ${BUILD_FOLDER}/fuse-ext2/fuse-ext2.install ${DISTRIBUTION_FOLDER}/usr/local/bin/fuse-ext2.install
-${INSTALL_C} -m 755 ${BUILD_FOLDER}/fuse-ext2/fuse-ext2.uninstall ${DISTRIBUTION_FOLDER}/usr/local/bin/fuse-ext2.uninstall
-${INSTALL_C} -m 644 ${BUILD_FOLDER}/fuse-ext2.pc ${DISTRIBUTION_FOLDER}/usr/local/lib/pkgconfig/fuse-ext2.pc
-${INSTALL_C} -m 644 ${SOURCE_FOLDER}/fuse-ext2.1 ${DISTRIBUTION_FOLDER}/usr/local/share/man/man1/fuse-ext2.1
-${INSTALL_C} -m 755 ${MKPKG_FOLDER}/fuse-ext2.fs/fuse-ext2.util ${DISTRIBUTION_FOLDER}/System/Library/Filesystems/fuse-ext2.fs/fuse-ext2.util
-${INSTALL_C} -m 755 ${MKPKG_FOLDER}/fuse-ext2.fs/mount_fuse-ext2 ${DISTRIBUTION_FOLDER}/System/Library/Filesystems/fuse-ext2.fs/mount_fuse-ext2
-${SED_E} "s/FUSEEXT2_VERSION_LITERAL/$FUSEEXT2_VERSION/g" < ${MKPKG_FOLDER}/fuse-ext2.fs/Contents/Info.plist.in > ${MKPKG_FOLDER}/fuse-ext2.fs/Contents/Info.plist
-${INSTALL_C} -m 644 ${MKPKG_FOLDER}/fuse-ext2.fs/Contents/Info.plist ${DISTRIBUTION_FOLDER}/System/Library/Filesystems/fuse-ext2.fs/Contents/Info.plist
-${INSTALL_C} -m 644 ${MKPKG_FOLDER}/fuse-ext2.fs/Contents/PkgInfo ${DISTRIBUTION_FOLDER}/System/Library/Filesystems/fuse-ext2.fs/Contents/PkgInfo
-${INSTALL_C} -m 644 ${MKPKG_FOLDER}/fuse-ext2.fs/Contents/Resources/English.lproj/InfoPlist.strings ${DISTRIBUTION_FOLDER}/System/Library/Filesystems/fuse-ext2.fs/Contents/Resources/English.lproj/InfoPlist.strings
-${LN_SF} ../System/Library/Filesystems/fuse-ext2.fs/mount_fuse-ext2 ${DISTRIBUTION_FOLDER}/sbin/mount_fuse-ext2
-${SED_E} "s/FUSEEXT2_VERSION_LITERAL/$FUSEEXT2_VERSION/g" < ${MKPKG_FOLDER}/Info.plist.in > ${MKPKG_FOLDER}/Info.plist
-${MV} ${MKPKG_FOLDER}/Info.plist ${TMP_FOLDER}/Info.plist
+make -f "$BUILD_FOLDER/Makefile" DESTDIR="$DISTRIBUTION_FOLDER" install
${CHOWN_R} root:wheel ${TMP_FOLDER}
-${SUDO} find ${DISTRIBUTION_FOLDER} -name ".svn" -type d | xargs ${SUDO} rm
-${PKGMANAGER} -build -p ${FUSEEXT2_NAME}.pkg \
- -f ${DISTRIBUTION_FOLDER} \
- -b ./ \
- -ds \
- -v \
- -r ${MKPKG_FOLDER}/Install_resources/ \
- -i ${TMP_FOLDER}/Info.plist \
- -d ${MKPKG_FOLDER}/Description.plist
+
+${PKGBUILD} --identifier ${FUSEEXT2_NAME} \
+ --root "$DISTRIBUTION_FOLDER" \
+ --version $FUSEEXT2_VERSION \
+ ${FUSEEXT2_NAME}.pkg
+
${CHOWN_R} root:admin ${FUSEEXT2_NAME}.pkg
sudo hdiutil create -layout NONE -megabytes 1 -fs HFS+ -volname "${FUSEEXT2_NAME}-${FUSEEXT2_VERSION}" "${TMP_FOLDER}/${FUSEEXT2_NAME}-${FUSEEXT2_VERSION}.dmg"
@@ -104,20 +63,20 @@ VOLUME_PATH="/Volumes/${FUSEEXT2_NAME}-${FUSEEXT2_VERSION}"
sudo cp -pRX ${FUSEEXT2_NAME}.pkg "$VOLUME_PATH"
# Set the custom icon.
-sudo cp -pRX "${MKPKG_FOLDER}/Install_resources/.VolumeIcon.icns" "$VOLUME_PATH"/.VolumeIcon.icns
-sudo /Developer/Tools/SetFile -a C "$VOLUME_PATH"
+sudo cp -pRX "${MKPKG_FOLDER}/Install_resources/.VolumeIcon.icns" "${VOLUME_PATH}/.VolumeIcon.icns"
+${SETFILE} -a C "$VOLUME_PATH"
# Copy over the license file.
-sudo cp "${MKPKG_FOLDER}/Install_resources/README.rtf" "$VOLUME_PATH"/README.rtf
-sudo cp "${MKPKG_FOLDER}/Install_resources/Authors.rtf" "$VOLUME_PATH"/Authors.rtf
-sudo cp "${MKPKG_FOLDER}/Install_resources/ChangeLog.rtf" "$VOLUME_PATH"/ChangeLog.rtf
-sudo cp "${MKPKG_FOLDER}/Install_resources/License.rtf" "$VOLUME_PATH"/License.rtf
+sudo cp "${MKPKG_FOLDER}/Install_resources/README.rtf" "${VOLUME_PATH}/README.rtf"
+sudo cp "${MKPKG_FOLDER}/Install_resources/Authors.rtf" "${VOLUME_PATH}/Authors.rtf"
+sudo cp "${MKPKG_FOLDER}/Install_resources/ChangeLog.rtf" "${VOLUME_PATH}/ChangeLog.rtf"
+sudo cp "${MKPKG_FOLDER}/Install_resources/License.rtf" "${VOLUME_PATH}/License.rtf"
# Detach the volume.
hdiutil detach "$VOLUME_PATH"
# Convert to a read-only compressed dmg.
-hdiutil convert -imagekey zlib-level=9 -format UDZO "${TMP_FOLDER}/${FUSEEXT2_NAME}-${FUSEEXT2_VERSION}.dmg" -o "${FUSEEXT2_NAME}-${FUSEEXT2_VERSION}.dmg"
+sudo hdiutil convert -imagekey zlib-level=9 -format UDZO "${TMP_FOLDER}/${FUSEEXT2_NAME}-${FUSEEXT2_VERSION}.dmg" -o "${FUSEEXT2_NAME}-${FUSEEXT2_VERSION}.dmg"
${RM_RF} ${TMP_FOLDER} ${FUSEEXT2_NAME}.pkg
@@ -20,7 +20,7 @@
static NSString *kinstallPath = @"/usr/local/bin/fuse-ext2.install";
static NSString *kuninstallPath = @"/usr/local/bin/fuse-ext2.uninstall";
static NSString *kinstalledPath = @"/Library/Filesystems/fuse-ext2.fs/Contents/Info.plist";
-static NSString *kaboutLabelString = @"fuse-ext2 is a ext2/ext3 filesystem support for Fuse. Please visit fuse-ext2 webpage (http://fuse-ext2.sourceforge.net/) for more information.";
+static NSString *kaboutLabelString = @"fuse-ext2 is a ext2/ext3/ext4 filesystem support for Fuse. Please visit fuse-ext2 webpage (https://github.com/alperakcan/fuse-ext2) for more information.";
static NSString *kinstalledString = @"Installed Version:";
static NSString *kinstallingString = @"Installing new version.";
static NSString *kcheckingString = @"Checking for new version.";

0 comments on commit 3855945

Please sign in to comment.