cloc rpm安装包制作

258 阅读1分钟

[toc]

简介

centos7的rpm源比较老,没有cloc,干脆制作一个,仅供学习,使用此时20220524的最新版本1.64制作,源码未做任何修改

下载

源码包 天翼云盘 访问码:4cim RPM X86_64包 阿里云盘 提取码:jb51

文件结构

[kira@localhost rpmbuild]$ tree
.
├── BUILD
├── BUILDROOT
├── RPMS
│   └── x86_64
│       └── cloc-1.64-1.el7.x86_64.rpm
├── SOURCES
│   └── cloc-1.64.tar.gz
├── SPECS
│   └── cloc.spec
└── SRPMS

7 directories, 3 files
[kira@localhost rpmbuild]$

cloc-1.64-1.el7.x86_64.rpm 可直接安装在x86_64平台中,其他可自行在SPECS文件夹中执行 rpmbuild -bb cloc.spec 构建

SPEC

Name:           cloc
Version:        1.64
Release:        1%{?dist}
Summary:        Count Lines of Code

License:        GNUV2
URL:            http://cloc.sourceforge.net/
Source0:        https://sourceforge.net/projects/cloc/files/cloc/v1.64/cloc-%{version}.tar.gz
# Source0:      https://sourceforge.net/projects/cloc/files/cloc/v1.64/cloc-%{version}.tar.gz/download

BuildRequires:  cmake
# Requires:       

%description
Why Use cloc? ^
cloc has many features that make it easy to use, thorough, extensible, and portable:

Exists as a single, self-contained file that requires minimal installation effort---just download the file and run it.
Can read language comment definitions from a file and thus potentially work with computer languages that do not yet exist.
Allows results from multiple runs to be summed together by language and by project.
Can produce results in a variety of formats: plain text, SQL, XML, YAML, comma separated values.
Can count code within compressed archives (tar balls, Zip files, Java .ear files).
Has numerous troubleshooting options.
Handles file and directory names with spaces and other unusual characters.
Has no dependencies outside the standard Perl distribution.
Runs on Linux, FreeBSD, NetBSD, OpenBSD, Mac OS X, AIX, HP-UX, Solaris, IRIX, and z/OS systems that have Perl 5.6 or higher. The source version runs on Windows with either ActiveState Perl, Strawberry Perl, Cygwin, or MobaXTerm+Perl plugin. Alternatively on Windows one can run the Windows binary which has no dependencies.

%prep
%setup -q


%build
echo "nothing"


%install
mkdir -p $RPM_BUILD_ROOT%{_bindir}

make -i prefix=$RPM_BUILD_ROOT%{_bindir} install
mv $RPM_BUILD_ROOT%{_bindir}/bin/cloc $RPM_BUILD_ROOT%{_bindir}/cloc
chmod +x $RPM_BUILD_ROOT%{_bindir}/cloc
#%make_install


%files
/%{_bindir}/cloc
/%{_bindir}/share/man/man1/cloc.1


%changelog

历史记录

  • 2022-07-04
    • 添加rpm包下载地址