add packaging
authorAnas Nashif <anas.nashif@intel.com>
Mon, 5 Nov 2012 19:26:05 +0000 (11:26 -0800)
committerAnas Nashif <anas.nashif@intel.com>
Mon, 5 Nov 2012 19:26:05 +0000 (11:26 -0800)
packaging/mtools-4.0.17-aliasing.diff [new file with mode: 0644]
packaging/mtools-4.0.17-autoconf.diff [new file with mode: 0644]
packaging/mtools-4.0.17-conf.diff [new file with mode: 0644]
packaging/mtools-4.0.17-fat-bits.diff [new file with mode: 0644]
packaging/mtools-4.0.17-prototypes.diff [new file with mode: 0644]
packaging/mtools.spec [new file with mode: 0644]

diff --git a/packaging/mtools-4.0.17-aliasing.diff b/packaging/mtools-4.0.17-aliasing.diff
new file mode 100644 (file)
index 0000000..96c276c
--- /dev/null
@@ -0,0 +1,13 @@
+Index: file.c
+===================================================================
+--- file.c.orig
++++ file.c
+@@ -591,7 +591,7 @@ static Stream_t *_internalFileOpen(Strea
+               Pattern.loopDetectRel = 0;
+               Pattern.loopDetectAbs = first;
+               if(!hash_lookup(filehash, (T_HashTableEl) &Pattern,
+-                              (T_HashTableEl **)&File, 0)){
++                              (T_HashTableEl **)(void *)&File, 0)){
+                       File->refs++;
+                       This->refs--;
+                       return (Stream_t *) File;
diff --git a/packaging/mtools-4.0.17-autoconf.diff b/packaging/mtools-4.0.17-autoconf.diff
new file mode 100644 (file)
index 0000000..394a36a
--- /dev/null
@@ -0,0 +1,48 @@
+Index: configure.in
+===================================================================
+--- configure.in.orig
++++ configure.in
+@@ -110,10 +110,10 @@ dnl
+ dnl
+ AC_MSG_CHECKING(whether llseek declared in unistd.h)
+ AC_CACHE_VAL(mtools_cv_have_llseek_prototype,
+-        AC_TRY_COMPILE(
++        [AC_TRY_COMPILE(
+ [#include <unistd.h>], [extern int llseek(int);],
+         [mtools_cv_have_llseek_prototype=no],
+-        [mtools_cv_have_llseek_prototype=yes]))
++        [mtools_cv_have_llseek_prototype=yes])])
+ AC_MSG_RESULT($mtools_cv_have_llseek_prototype)
+ if test "$mtools_cv_have_llseek_prototype" = yes; then
+    AC_DEFINE([HAVE_LLSEEK_PROTOTYPE],1,[Define when you have an LLSEEK prototype])
+@@ -121,13 +121,13 @@ fi
+ AC_MSG_CHECKING(whether lseek64 declared in unistd.h)
+ AC_CACHE_VAL(mtools_cv_have_lseek64_prototype,
+-        AC_TRY_COMPILE(
++        [AC_TRY_COMPILE(
+ [
+ #include "sysincludes.h"
+ #include <unistd.h>
+ ], [extern int lseek64(int);],
+         [mtools_cv_have_lseek64_prototype=no],
+-        [mtools_cv_have_lseek64_prototype=yes]))
++        [mtools_cv_have_lseek64_prototype=yes])])
+ AC_MSG_RESULT($mtools_cv_have_lseek64_prototype)
+ if test "$mtools_cv_have_lseek64_prototype" = yes; then
+    AC_DEFINE([HAVE_LSEEK64_PROTOTYPE],1,[Define when you have an LSEEK64 prototype])
+@@ -163,12 +163,12 @@ dnl Check for 64-bit off_t
+ dnl
+ AC_DEFUN(SFS_CHECK_OFF_T_64,
+ [AC_CACHE_CHECK(for 64-bit off_t, sfs_cv_off_t_64,
+-AC_TRY_COMPILE([
++[AC_TRY_COMPILE([
+ #include <unistd.h>
+ #include <sys/types.h>
+ ],[
+ switch (0) case 0: case (sizeof (off_t) <= 4):;
+-], sfs_cv_off_t_64=no, sfs_cv_off_t_64=yes))
++], sfs_cv_off_t_64=no, sfs_cv_off_t_64=yes)])
+ if test $sfs_cv_off_t_64 = yes; then
+         AC_DEFINE([HAVE_OFF_T_64],1,[Define when the system has a 64 bit off_t type])
+ fi])
diff --git a/packaging/mtools-4.0.17-conf.diff b/packaging/mtools-4.0.17-conf.diff
new file mode 100644 (file)
index 0000000..ef68ea5
--- /dev/null
@@ -0,0 +1,61 @@
+--- mtools.conf
++++ mtools.conf
+@@ -14,25 +14,20 @@
+ # You should have received a copy of the GNU General Public License
+ # along with Mtools.  If not, see <http://www.gnu.org/licenses/>.
+-# Example mtools.conf files.  Uncomment the lines which correspond to
+-# your architecture and comment out the "SAMPLE FILE" line below
+-SAMPLE FILE
++drive a: file="/dev/fd0" exclusive mformat_only cylinders=80 heads=2 sectors=18
++drive b: file="/dev/fd1" exclusive mformat_only cylinders=80 heads=2 sectors=18
+-# # Linux floppy drives
+-# drive a: file="/dev/fd0" exclusive
+-# drive b: file="/dev/fd1" exclusive
++# First SCSI hard disk partition
++drive c: file="/dev/sda1"
+-# # First SCSI hard disk partition
+-# drive c: file="/dev/sda1"
++# First IDE hard disk partition
++#drive c: file="/dev/hda1"
+-# # First IDE hard disk partition
+-# drive c: file="/dev/hda1"
++#dosemu floppy image
++drive m: file="/var/lib/dosemu/diskimage"
+-# # dosemu floppy image
+-# drive m: file="/var/lib/dosemu/diskimage"
+-
+-# # dosemu hdimage
+-# drive n: file="/var/lib/dosemu/diskimage" offset=3840
++#dosemu hdimage
++drive n: file="/var/lib/dosemu/hdimage.first" MTOOLS_SKIP_CHECK=1 MTOOLS_LOWER_CASE=1 MTOOLS_NO_VFAT=1 partition=1 offset=128
+ # # Atari ramdisk image
+ # drive o: file="/tmp/atari_rd" offset=136
+@@ -60,21 +55,4 @@
+ # ZIP drive on SCSI ID 6
+ #drive z: file="/dev/scsi_disk_060" offset=16384 fat_bits=16                        
+-# SCO Unix 3.2v4
+-# # Floppy disk drives
+-#
+-# drive a: file="/dev/install" exclusive
+-# drive b: file="/dev/install1" exclusive
+-#  
+-# # SCSI hard disk partitions
+-#  
+-# drive c: file="/dev/dsk/0sC"
+-# drive d: file="/dev/dsk/0sD"
+-# drive e: file="/dev/dsk/0sE"
+-# drive f: file="/dev/dsk/0sF"
+-# drive g: file="/dev/dsk/0sG"
+-# drive h: file="/dev/dsk/0sH"
+-
+-# # uncomment the following line to display all file names in lower
+-# # case by default
+-# mtools_lower_case=1
++mtools_lower_case=1
diff --git a/packaging/mtools-4.0.17-fat-bits.diff b/packaging/mtools-4.0.17-fat-bits.diff
new file mode 100644 (file)
index 0000000..b102d19
--- /dev/null
@@ -0,0 +1,13 @@
+Index: fat.c
+===================================================================
+--- fat.c.orig
++++ fat.c
+@@ -722,7 +722,7 @@ static int old_fat_read(Fs_t *This, unio
+       if(check_media_type(This,boot, tot_sectors))
+               return -1;
+-      if(This->num_clus >= FAT12) {
++      if(This->num_clus >= FAT12 || config_fat_bits == 16) {
+               set_fat16(This);
+               /* third FAT byte must be 0xff */
+               if(!mtools_skip_check && readByte(This, 3) != 0xff)
diff --git a/packaging/mtools-4.0.17-prototypes.diff b/packaging/mtools-4.0.17-prototypes.diff
new file mode 100644 (file)
index 0000000..b573644
--- /dev/null
@@ -0,0 +1,63 @@
+Index: mformat.c
+===================================================================
+--- mformat.c.orig
++++ mformat.c
+@@ -19,6 +19,7 @@
+  */
+ #define DONT_NEED_WAIT
++#define DONT_NEED_IN
+ #include "sysincludes.h"
+ #include "msdos.h"
+@@ -48,7 +49,7 @@
+ #define _LINUX_STRING_H_
+ #define kdev_t int
+-#include "linux/fs.h"
++#include "sys/mount.h"
+ #undef _LINUX_STRING_H_
+ #endif
+Index: mpartition.c
+===================================================================
+--- mpartition.c.orig
++++ mpartition.c
+@@ -17,6 +17,7 @@
+  * mformat.c
+  */
+ #define DONT_NEED_WAIT
++#define DONT_NEED_IN
+ #include "sysincludes.h"
+ #include "msdos.h"
+@@ -35,7 +36,7 @@
+ #define _LINUX_STRING_H_
+ #define kdev_t int
+-#include "linux/fs.h"
++#include "sys/mount.h"
+ #undef _LINUX_STRING_H_
+ #endif
+Index: sysincludes.h
+===================================================================
+--- sysincludes.h.orig
++++ sysincludes.h
+@@ -331,12 +331,16 @@ typedef unsigned int uid_t;
+ #endif
+ #ifdef HAVE_NETINET_IN_H
++#ifndef DONT_NEED_IN
+ #include <netinet/in.h>
+ #endif
++#endif
+ #ifdef HAVE_ARPA_INET_H
++#ifndef DONT_NEED_IN
+ #include <arpa/inet.h>
+ #endif
++#endif
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
diff --git a/packaging/mtools.spec b/packaging/mtools.spec
new file mode 100644 (file)
index 0000000..bd16b33
--- /dev/null
@@ -0,0 +1,72 @@
+Name:           mtools
+#BuildRequires:  xorg-x11
+#BuildRequires:  xorg-x11-devel
+Version:        4.0.17
+Release:        0
+License:        GPL-3.0+
+Summary:        Access Files on an MS-DOS File System
+Url:            http://mtools.linux.lu/
+Group:          System/Filesystems
+Source:         %{name}-%{version}.tar.bz2
+Patch0:         %{name}-%{version}-conf.diff
+Patch1:         %{name}-%{version}-autoconf.diff
+Patch3:         %{name}-%{version}-aliasing.diff
+Patch4:         %{name}-%{version}-fat-bits.diff
+Patch5:         %{name}-%{version}-prototypes.diff
+BuildRequires:  autoconf
+#BuildRequires:  libpng
+BuildRequires:  makeinfo
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+
+%description
+Mtools allows uncomplicated access to an MS-DOS file system on disk
+without mounting it. It includes commands for working with MS-DOS
+files: mdir, mcd, mcopy, and mformat.
+
+XDF support for OS/2 is also provided.
+
+%package doc
+License:        GPL-3.0+ and GFDL-1.3
+Summary:        Access Files on an MS-DOS File System
+Group:          System/Filesystems
+Requires:       %{name} = %{version}
+
+%description doc
+Mtools allows uncomplicated access to an MS-DOS file system on disk
+without mounting it. It includes commands for working with MS-DOS
+files: mdir, mcd, mcopy, and mformat.
+
+XDF support for OS/2 is also provided.
+
+%prep
+%setup -q
+%patch0
+%patch1
+%patch3
+%patch4
+%patch5
+
+%build
+autoconf --force
+export CC=gcc
+export INSTALL_PROGRAM="install"
+%configure \
+    --includedir=/usr/src/linux/include
+
+%install
+install -d -m 755 %{buildroot}%{_sysconfdir}
+%make_install
+cp -p mtools.conf %{buildroot}%{_sysconfdir}
+
+rm -rf %{buildroot}%{_mandir}/man?*/f*
+rm -rf %{buildroot}%{_bindir}/f*
+
+%docs_package
+
+%files
+%defattr(-,root,root)
+%config %{_sysconfdir}/mtools.conf
+%{_bindir}/*
+
+
+%changelog