git: 421ec032dd0e - main - filesystems/fatsort: Add new port

From: Ganael LAPLANCHE <martymac_at_FreeBSD.org>
Date: Fri, 25 Sep 2026 10:36:51 UTC
The branch main has been updated by martymac:

URL: https://cgit.FreeBSD.org/ports/commit/?id=421ec032dd0e87185ba424b7d77662fda772b713

commit 421ec032dd0e87185ba424b7d77662fda772b713
Author:     Ganael LAPLANCHE <martymac@FreeBSD.org>
AuthorDate: 2026-09-25 10:33:58 +0000
Commit:     Ganael LAPLANCHE <martymac@FreeBSD.org>
CommitDate: 2026-09-25 10:36:42 +0000

    filesystems/fatsort: Add new port
    
    FATSort is a C-based utility that sorts FAT12, FAT16, FAT32, and exFAT
    partitions. It fully supports long file name entries and recursively
    sorts directory structures by reading the file system’s boot sector.
    
    WWW:    https://sourceforge.net/projects/fatsort
---
 filesystems/Makefile                         |  1 +
 filesystems/fatsort/Makefile                 | 20 ++++++++++++++++++++
 filesystems/fatsort/distinfo                 |  3 +++
 filesystems/fatsort/files/patch-Makefile     | 11 +++++++++++
 filesystems/fatsort/files/patch-src-Makefile | 19 +++++++++++++++++++
 filesystems/fatsort/pkg-descr                |  7 +++++++
 6 files changed, 61 insertions(+)

diff --git a/filesystems/Makefile b/filesystems/Makefile
index 6eeceac039c7..1ca38dbdb20e 100644
--- a/filesystems/Makefile
+++ b/filesystems/Makefile
@@ -28,6 +28,7 @@
     SUBDIR += exfat
     SUBDIR += exfat-utils
     SUBDIR += ext2
+    SUBDIR += fatsort
     SUBDIR += fstyp
     SUBDIR += fswatch-mon
     SUBDIR += fusefs-libs
diff --git a/filesystems/fatsort/Makefile b/filesystems/fatsort/Makefile
new file mode 100644
index 000000000000..702bd963c875
--- /dev/null
+++ b/filesystems/fatsort/Makefile
@@ -0,0 +1,20 @@
+PORTNAME=	fatsort
+PORTVERSION=	1.7.1.683
+CATEGORIES=	filesystems
+MASTER_SITES=	SF/${PORTNAME}
+
+MAINTAINER=	martymac@FreeBSD.org
+COMMENT=	FATSort sorts directory structures of FAT file systems
+WWW=		https://sourceforge.net/projects/fatsort
+
+LICENSE=	GPLv2+
+LICENSE_FILE=	${WRKSRC}/LICENSE.txt
+
+USES=	gmake tar:xz
+
+MAKE_ENV=	MANDIR=${PREFIX}/share/man/man1 \
+		INSTALL_FLAGS="-m 0555 -p"
+
+PLIST_FILES=	sbin/fatsort share/man/man1/fatsort.1.gz
+
+.include <bsd.port.mk>
diff --git a/filesystems/fatsort/distinfo b/filesystems/fatsort/distinfo
new file mode 100644
index 000000000000..da795961c7db
--- /dev/null
+++ b/filesystems/fatsort/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1790271327
+SHA256 (fatsort-1.7.1.683.tar.xz) = 58d93e3a1096d2219202379ff1cacdf0abc0b3d9edb5fbd6deabdd954dc3ec68
+SIZE (fatsort-1.7.1.683.tar.xz) = 139972
diff --git a/filesystems/fatsort/files/patch-Makefile b/filesystems/fatsort/files/patch-Makefile
new file mode 100644
index 000000000000..5198af86331f
--- /dev/null
+++ b/filesystems/fatsort/files/patch-Makefile
@@ -0,0 +1,11 @@
+--- Makefile.orig	2020-08-08 10:38:31 UTC
++++ Makefile
+@@ -1,6 +1,6 @@
+-MANDIR=/usr/local/share/man/man1
++MANDIR?=/usr/local/share/man/man1
+ 
+-INSTALL_FLAGS=-m 0755 -p -D
++INSTALL_FLAGS?=-m 0755 -p -D
+ 
+ #detect Mac OS X
+ UNAME=$(shell uname -s)
diff --git a/filesystems/fatsort/files/patch-src-Makefile b/filesystems/fatsort/files/patch-src-Makefile
new file mode 100644
index 000000000000..1b5f4d34502b
--- /dev/null
+++ b/filesystems/fatsort/files/patch-src-Makefile
@@ -0,0 +1,19 @@
+--- src/Makefile.orig	2023-03-11 15:06:49 UTC
++++ src/Makefile
+@@ -1,5 +1,5 @@
+-CC=gcc
+-LD=gcc
++CC?=gcc
++LD?=gcc
+ 
+ ifdef DEBUG
+ CFLAGS += -g -DDEBUG=$(DEBUG) -fstack-protector-all
+@@ -11,7 +11,7 @@ override CFLAGS+= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_B
+ CFLAGS += -Wall -Wextra
+ override CFLAGS+= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE ${CPPFLAGS}
+ 
+-INSTALL_FLAGS=-m 0755 -p -D
++INSTALL_FLAGS?=-m 0755 -p -D
+ 
+ UNAME_S := $(shell uname -s)
+ UNAME_P := $(shell uname -p)
diff --git a/filesystems/fatsort/pkg-descr b/filesystems/fatsort/pkg-descr
new file mode 100644
index 000000000000..c3603a726919
--- /dev/null
+++ b/filesystems/fatsort/pkg-descr
@@ -0,0 +1,7 @@
+FATSort is a C-based utility that sorts FAT12, FAT16, FAT32, and exFAT
+partitions. It fully supports long file name entries and recursively sorts
+directory structures by reading the file system’s boot sector.
+
+The tool was originally developed to organize MP3 files on a hardware MP3
+player that did not support automatic file sorting. Since no suitable utility
+existed at the time, FATSort was written to fill that gap.