# To reduce boilerplate.
%global make_cmd %make_build CC=%{__cc} \\\
CFLAGS="%{build_cflags}" LDFLAGS="%{build_ldflags}"
# Needed meta-data from git repo.
%global owner PTV_Claus
%global git_sha 69a35800d67cab71701e625cac56bfa62dc9c984
%global sha_short %(c=%{git_sha}; echo ${c:0:12})
Name: cc1541
Version: 2.0
Release: 1%{?dist}
Summary: Tool for creating Commodore 1541 Floppy disk images in D64, G64 or D71 format
License: MIT
URL: https://bitbucket.org/%{owner}/%{name}
Source0: %{url}/get/%{version}.tar.bz2#/%{name}-%{version}.tar.bz2
BuildRequires: gcc
BuildRequires: make
# Patches from upstream.
Patch0001: 0001-Added-B-switch-to-specify-DIR-block-size.-Also-made-.patch
Patch0002: 0002-Tabs-to-spaces.patch
Patch0003: 0004-Add-make-target-to-run-tests.patch
Patch0004: 0006-Added-L-switch-to-reference-loop-files-by-index.patch
Patch0005: 0011-Resolve-strange-deviating-versions.patch
Patch0006: 0012-Fix-for-L-switch-used-always-index-0-and-also-did-no.patch
Patch0007: 0014-Using-variable-for-compiler-to-prepare-for-MinGW-bui.patch
Patch0008: 0018-gitignore-Add-basic-ignore-rules-for-git.patch
Patch0009: 0019-LICENSE.txt-Add-license-file-for-distribution-packag.patch
Patch0010: 0020-Makefile-Allow-user-specified-compiler-flags-to-be-u.patch
Patch0011: 0021-Makefile-Run-top-level-clean-target-recursively.patch
Patch0012: 0022-Makefile-Add-top-level-check-test-target.patch
Patch0013: 0023-test_cc1541-Makefile-Add-check-target.patch
Patch0014: 0024-cc1541-Fix-Wmaybe-uninitialized.patch
Patch0015: 0025-cc1541-Fix-Wunused-result.patch
Patch0016: 0026-cc1541-Fix-Wformat-extra-args.patch
Patch0017: 0027-cc1541-Fix-Wformat.patch
Patch0018: 0028-cc1541-Fix-Wtype-limits.patch
Patch0019: 0029-test_cc1541-Fix-Wunused-result.patch
Patch0020: 0030-cc1541-Fix-segfault-with-GCC-8-and-O2.patch
%description
This is %{name} v%{version}, a tool for creating Commodore 1541
Floppy disk images in D64, G64 or D71 format with custom sector
interleaving etc. Also supports extended tracks 35-40 using
either SPEED DOS or DOLPHIN DOS BAM-formatting.
%prep
%autosetup -p 1 -n %{owner}-%{name}-%{sha_short}
# Remove pre-built binaries.
%{__rm} -fr rel/
%build
%{make_cmd}
%install
# No install rule in Makefile.
%{__install} -Dpm 0755 %{name} %{buildroot}%{_bindir}/%{name}
%check
%{make_cmd} check
%files
%license LICENSE.txt
%doc README.md
%{_bindir}/%{name}
%changelog
* Fri Jun 21 2019 Björn Esser <besser82@fedoraproject.org> - 2.0-1
- Initial import (#1722942)
* Fri Jun 21 2019 Björn Esser <besser82@fedoraproject.org> - 2.0-0.3
- Upstream PR has been merged
* Fri Jun 21 2019 Björn Esser <besser82@fedoraproject.org> - 2.0-0.2
- Remove pre-built binaries from build-tree during %%prep.
* Fri Jun 21 2019 Björn Esser <besser82@fedoraproject.org> - 2.0-0.1
- Initial rpm release (#1722942)