Compare commits

..

No commits in common. "59d1cb01c31cfe1b62e7b834f3df8914719e4eae" and "b4d25539ae3735f3e6b0f06b933df134cf01dcb2" have entirely different histories.

5 changed files with 69 additions and 128 deletions

View File

@ -0,0 +1,32 @@
From 0e4fbdbdbfbaccec47187e39632398ce32399be9 Mon Sep 17 00:00:00 2001
From: herengui <herengui@uniontech.com>
Date: Fri, 2 Apr 2021 15:02:37 +0800
Subject: [PATCH] 修改make.sh中复制scripts的逻辑脚本文件放置到/usr/share/fastdfs/bin目录中
直接放到/usr/bin目录中文件名不能自解释脚本功能。
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
make.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/make.sh b/make.sh
index 69bb072..a1c1304 100755
--- a/make.sh
+++ b/make.sh
@@ -156,8 +156,9 @@ cd ..
if [ "$1" = "install" ]; then
cd ..
- cp -f restart.sh $TARGET_PREFIX/bin
- cp -f stop.sh $TARGET_PREFIX/bin
+ SHARE_BIN_DIR=$TARGET_PREFIX/share/fastdfs/bin
+ mkdir -p $SHARE_BIN_DIR
+ cp -f restart.sh stop.sh $SHARE_BIN_DIR
if [ "$uname" = "Linux" ]; then
if [ "$WITH_LINUX_SERVICE" = "1" ]; then
--
2.27.0

View File

@ -1,80 +0,0 @@
From 75c5535f5a9853dfe8302cd5852bb36bc518fde5 Mon Sep 17 00:00:00 2001
From: YuQing <384681@qq.com>
Date: Mon, 11 Mar 2024 15:25:41 +0800
Subject: [PATCH] remove compile warnings
---
client/storage_client.c | 23 +++++++++++++----------
storage/storage_service.c | 2 +-
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/client/storage_client.c b/client/storage_client.c
index 5acfa9b..6f05742 100644
--- a/client/storage_client.c
+++ b/client/storage_client.c
@@ -919,7 +919,7 @@ int storage_do_upload_file(ConnectionInfo *pTrackerServer, \
char in_buff[128];
char *pInBuff;
ConnectionInfo storageServer;
- bool new_connection;
+ bool new_connection = false;
bool bUploadSlave;
int new_store_path;
int master_filename_len;
@@ -948,19 +948,22 @@ int storage_do_upload_file(ConnectionInfo *pTrackerServer, \
bUploadSlave = (strlen(group_name) > 0 && master_filename_len > 0);
if (bUploadSlave)
{
- if ((result=storage_get_update_connection(pTrackerServer, \
- &pStorageServer, group_name, master_filename, \
+ if ((result=storage_get_update_connection(pTrackerServer,
+ &pStorageServer, group_name, master_filename,
&storageServer, &new_connection)) != 0)
{
return result;
}
}
- else if ((result=storage_get_upload_connection(pTrackerServer, \
- &pStorageServer, group_name, &storageServer, \
- &new_store_path, &new_connection)) != 0)
+ else
{
- *group_name = '\0';
- return result;
+ if ((result=storage_get_upload_connection(pTrackerServer,
+ &pStorageServer, group_name, &storageServer,
+ &new_store_path, &new_connection)) != 0)
+ {
+ *group_name = '\0';
+ return result;
+ }
}
*group_name = '\0';
@@ -1264,8 +1267,8 @@ int storage_set_metadata(ConnectionInfo *pTrackerServer, \
char *pEnd;
bool new_connection;
- if ((result=storage_get_update_connection(pTrackerServer, \
- &pStorageServer, group_name, filename, \
+ if ((result=storage_get_update_connection(pTrackerServer,
+ &pStorageServer, group_name, filename,
&storageServer, &new_connection)) != 0)
{
return result;
diff --git a/storage/storage_service.c b/storage/storage_service.c
index 0a0ae82..5eea899 100644
--- a/storage/storage_service.c
+++ b/storage/storage_service.c
@@ -1783,7 +1783,7 @@ void storage_get_store_path(const char *filename, const int filename_len, \
{ \
int r; \
r = (rand() & 0x007FFFFF) | 0x80000000; \
- masked_file_size = (((int64_t)r) << 32 ) | file_size; \
+ masked_file_size = (((int64_t)r) << 32 ) | (file_size); \
} while (0)
--
2.27.0

BIN
V6.06.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
Name: fastdfs
Version: 6.12.0
Version: 6.06
Release: 2
Summary: FastDFS server and client
License: GPL3.0
@ -7,30 +7,24 @@ Group: Arch/Tech
URL: https://github.com/happyfish100/fastdfs
Source: https://github.com/happyfish100/fastdfs/archive/V%{version}.tar.gz
Patch1: 0001-remove-compile-warnings-in-client-and-storage.patch
Patch0: 0001-move_scripts_to_data_dir.patch
Requires: gcc cmake
BuildRequires: libfastcommon-devel >= 1.0.66
BuildRequires: libserverframe-devel >= 1.2.1
BuildRequires: perl
BuildRequires: libfastcommon-devel >= 1.0.43
%description
This package provides tracker & storage of fastdfs
%package -n fastdfs-server
Requires: libfastcommon >= 1.0.66
Requires: libserverframe >= 1.2.1
Requires: fastdfs-config
Requires: libfastcommon >= 1.0.43
Summary: fastdfs tracker & storage
%package -n fastdfs-tools
Requires: libfdfsclient
Requires: libfastcommon
Summary: fastdfs tools
%package -n libfdfsclient
Requires: libfastcommon >= 1.0.66
Requires: libserverframe >= 1.2.1
Requires: fastdfs-config
Requires: libfastcommon
Summary: The client dynamic library of fastdfs
%package -n libfdfsclient-devel
@ -46,53 +40,67 @@ This package is client dynamic library of fastdfs
%description -n libfdfsclient-devel
This package is client header of fastdfs client
%package -n fastdfs-config
Summary: FastDFS config files for sample
%description -n fastdfs-tools
This package is tools for fastdfs
%description -n fastdfs-config
FastDFS config files for sample
commit version: $COMMIT_VERSION
%prep
%autosetup -n %{name}-%{version} -p1
%autosetup -p1
%build
./make.sh clean && ./make.sh
./make.sh
%install
rm -rf %{buildroot}
DESTDIR=$RPM_BUILD_ROOT ./make.sh install
rm -f %{buildroot}/etc/fdfs/http.conf.sample
rm -f %{buildroot}/etc/fdfs/mime.types.sample
%post
%post -n fastdfs-server
/sbin/chkconfig --add fdfs_trackerd
/sbin/chkconfig --add fdfs_storaged
%postun
create_symbolic_link() {
local source_file="%{_datadir}/%{name}/bin/$1"
local target_file="%{_bindir}/fdfs_$1"
test -f "${source_file}" && ln -sf "${source_file}" "${target_file}"
}
create_symbolic_link "restart.sh"
create_symbolic_link "stop.sh"
%preun -n fastdfs-server
/sbin/chkconfig --del fdfs_trackerd
/sbin/chkconfig --del fdfs_storaged
%postun -n fastdfs-server
find %{_bindir} -maxdepth 1 -type l \
-name "fdfs_restart.sh" -delete -o \
-name "fdfs_stop.sh" -delete
%clean
rm -rf %{buildroot}
%files
%files -n fastdfs-server
%defattr(-,root,root,-)
%{_bindir}/fdfs_trackerd
%{_bindir}/fdfs_storaged
%config(noreplace) /usr/lib/systemd/system/fdfs_trackerd.service
%config(noreplace) /usr/lib/systemd/system/fdfs_storaged.service
%{_datadir}/%{name}/bin/restart.sh
%{_datadir}/%{name}/bin/stop.sh
%{_sysconfdir}/init.d/*
%{_sysconfdir}/fdfs/tracker.conf.sample
%{_sysconfdir}/fdfs/storage.conf.sample
%{_sysconfdir}/fdfs/storage_ids.conf.sample
%files -n libfdfsclient
%defattr(-,root,root,-)
%{_libdir}/libfdfsclient*
%{_usr}/lib/libfdfsclient*
%{_sysconfdir}/fdfs/client.conf.sample
%files -n libfdfsclient-devel
%defattr(-,root,root,-)
%{_includedir}/fastdfs/*
%files -n fastdfs-tools
%defattr(-,root,root,-)
%{_bindir}/fdfs_monitor
%{_bindir}/fdfs_test
%{_bindir}/fdfs_test1
@ -107,26 +115,7 @@ rm -rf %{buildroot}
%{_bindir}/fdfs_upload_appender
%{_bindir}/fdfs_regenerate_filename
%files -n fastdfs-config
%defattr(-,root,root,-)
%config(noreplace) /etc/fdfs/*.conf
%changelog
* Fri Aug 2 2024 zhangyaqi <zhangyaqi@kylinos.cn> - 6.12.0-2
- remove compile warnings
* Mon Feb 26 2024 liweigang <izmirvii@gmail.com> - 6.12.0-1
- update to version 6.12.0
* Mon Mar 20 2023 suweifeng <suweifeng@huawei.com> - 6.9.4-1
- Upgrade to version 6.9.4
* Fri Dec 16 2022 lihaoxiang <lihaoxiang9@huawei.com> - 6.9.1-1
- Upgrade to version 6.9.1
* Thu Jun 23 2022 lihaoxiang <lihaoxiang9@huawei.com> - 6.06-3
- Modified fastdfs.spec that add BuildRequires about perl
* Fri Apr 02 2021 herengui <herengui@uniontech.com> - 6.06-2
- Rearrange the files list