001_fpm打包命令详解

使用fpm来制作rpm包

2017/2/22


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512

513

514

515

516

517

518

519

520

521

522

523

524

525

526

527

528

529

530

531

532

533

534

535

536

537

538

539

540

541

542

543

544

545

546

547

548

549

550

551

552

553

554

555

556

557

558

559

560

561

562

563

564

565

566

567

568

569

一、配置fpm环境

1、安装ruby和fpm

使用rvm来管理ruby

curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -

curl -L https://get.rvm.io | bash -s stable --ruby

重新打开一个shell

# ruby -v

ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]

安装fpm依赖包

yum install rpm-build -y

安装fpm

[[email protected] ~]# gem install fpm -V

2、fpm的参数

参考:https://github.com/jordansissel/fpm/wiki

% fpm -s <source type> -t <target type> [options]

-s                          源格式

-t                          目标格式

-n                          包名

-v                          version值,实际版本号

--iteration                 release值,发布序列号

--epoch                     epoch值

--vendor                    厂商

--maintainer                维护者

--description               描述

--url                       软件主页

--workdir                   fpm工作目录

-d                          依赖的软件包

--directories               递归指定的目录标记为属于这个包

-C                          切换到指定的目录

-p                          输出到指定的路径

--force                     强制覆盖文件

--after-install FILE        包安装后执行的脚本

--before-install FILE       包安装前执行的脚本

--after-remove FILE         包移除后执行的脚本

--before-remove FILE        包移除前执行的脚本

--after-upgrade FILE        包升级后执行的脚本

--before-upgrade FILE       包升级前执行的脚本

-e                          building前编辑spec文件

二、示例

【实例1:将python3的源码打包成rpm来安装】

1、配置编译python环境所需的包

[[email protected] ~]# mkdir /data/{download,rpms}

使用局域网的epel源:

[[email protected] ~]# mv /etc/yum.repos.d/*.repo /tmp/ \

&& wget http://mirrors.office.test/local-office.repo -O /etc/yum.repos.d/local-office.repo \

&& yum clean all \

&& yum makecache

注:如果要使用公网的epel源,可以这样操作:

# rpm -Uvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

[[email protected] ~]# yum -y groupinstall "Development tools"

[[email protected] ~]# yum -y install openssl-devel readline-devel bzip2-devel sqlite-devel zlib-devel ncurses-devel db4-devel expat-devel

下载最新的python源码包:

[[email protected] ~]# wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz -O /data/download/Python-3.4.3.tgz

[[email protected] ~]# cd /data/download/

[[email protected] download]# tar xf Python-3.4.3.tgz 

[[email protected] download]# cd Python-3.4.3

[[email protected] Python-3.4.3]

[[email protected] Python-3.4.3]# export DIR_PY_SRC_INSTALL=/data/rpms/Python-3.4.3

[[email protected] Python-3.4.3]# export DIR_PY_RPM_INSTALL=/usr/local

[[email protected] Python-3.4.3]# export LDFLAGS="-Wl,-rpath=${DIR_PY_RPM_INSTALL}/lib ${LDFLAGS}"

[[email protected] Python-3.4.3]# ./configure --prefix=${DIR_PY_RPM_INSTALL}

[[email protected] Python-3.4.3]# make

[[email protected] Python-3.4.3]# make install DESTDIR=${DIR_PY_SRC_INSTALL}

[[email protected] Python-3.4.3]# cd ..

我们来看一下,生成了那些目录和文件:

[[email protected] Python-3.4.3]# cd /data/rpms

[[email protected] Python-3.4.3]# ls Python-3.4.3/usr/local/

bin  include  lib  share

2、开始打包

[[email protected] Python-3.4.3]# fpm -s dir -t rpm \

    -n python3 \

    -v ‘3.4.3‘ \

    --iteration ‘1.el6‘ \

    --epoch ‘0‘ \

    --vendor ‘ Python Software Foundation‘ \

    --maintainer ‘PC‘ \

    --description ‘use fpm to make a pkg for python-3.4.3‘ \

    --url ‘https://www.python.org/downloads/release/python-343/‘ \

    --workdir /data/rpms \

    -p /data/rpms/pkgs/ \

    -C ${DIR_PY_SRC_INSTALL} \

    --directories=${DIR_PY_RPM_INSTALL}/lib \

    --directories=${DIR_PY_RPM_INSTALL}/include \

    -d ‘openssl‘ \

    -d ‘bzip2‘ \

    -d ‘zlib‘ \

    -d ‘expat‘ \

    -d ‘db4‘ \

    -d ‘sqlite‘ \

    -d ‘ncurses‘ \

    -d ‘readline‘

Created package {:path=>"/data/rpms/pkgs/python3-3.4.3-1.el6.x86_64.rpm"}

我们来看看包的内容:

[[email protected] rpms]# rpm -qpi pkgs/python3-3.4.3-1.el6.x86_64.rpm 

Name        : python3                      Relocations: / 

Version     : 3.4.3                             Vendor: Python Software Foundation

Release     : 1.el6                         Build Date: Wed 15 Jul 2015 04:55:17 PM CST

Install Date: (not installed)               Build Host: tvm-rpm

Group       : default                       Source RPM: python3-3.4.3-1.el6.src.rpm

Size        : 126285890                        License: unknown

Signature   : (none)

Packager    : PC

URL         : https://www.python.org/downloads/release/python-343/

Summary     : use fpm to make a pkg for python-3.4.3

Description :

use fpm to make a pkg for python-3.4.3

3、安装测试

1)安装前:

[[email protected] rpms]# ls /usr/local/{bin,include,lib,share/man}

/usr/local/bin:

/usr/local/include:

/usr/local/lib:

/usr/local/share/man/man1:

2)开始安装:

[[email protected] rpms]# rpm -ivh pkgs/python3-3.4.3-1.el6.x86_64.rpm 

Preparing...                ########################################### [100%]

   1:python3                ########################################### [100%]

[[email protected] rpms]# rpm -qa |grep python3

python3-3.4.3-1.el6.x86_64

3)安装后:

[[email protected] rpms]# ls /usr/local/{bin,include,lib,share/man/man1}

/usr/local/bin:

2to3  2to3-3.4  easy_install-3.4  idle3  idle3.4  pip3  pip3.4  pydoc3  pydoc3.4  python3  python3.4  python3.4-config  python3.4m  python3.4m-config  python3-config  pyvenv  pyvenv-3.4

/usr/local/include:

python3.4m

/usr/local/lib:

libpython3.4m.a  pkgconfig  python3.4

/usr/local/share/man/man1:

python3.1  python3.4.1

执行python命令,查看版本:

[[email protected] rpms]# python3 -c "import sys; print(sys.version)"

3.4.3 (default, Jul 15 2015, 14:40:59) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]

4)卸载:

[[email protected] rpms]# rpm -e python3-3.4.3-1.el6.x86_64           

[[email protected] rpms]# ls /usr/local/{bin,include,lib,share/man/man1}

/usr/local/bin:

/usr/local/include:

/usr/local/lib:

/usr/local/share/man/man1:

符合预期。

【实例2:打包yum源的配置文件为rpm包】

[[email protected] pkgs]# cd /data/rpms/pkgs/

[[email protected] pkgs]# fpm -s dir -t rpm \

    -a ‘x86_64‘ \

    -n ‘office-repo-latest‘ \

    -v ‘6‘ \

    --iteration ‘1.el6‘ \

    --epoch ‘0‘ \

    --vendor ‘[email protected]‘ \

    --maintainer ‘PC‘ \

    --description ‘provide file: [local-office.repo] for local users. include: centos-base, eple, user-define rpms‘ \

    /etc/yum.repos.d/local-office.repo 

    

Created package {:path=>"office-repo-latest-6-1.el6.noarch.rpm"}

[[email protected] pkgs]# rpm -qpl office-repo-latest-6-1.el6.x86_64.rpm 

/etc/yum.repos.d/local-office.repo

[[email protected] pkgs]# rpm -qpi office-repo-latest-6-1.el6.x86_64.rpm  

Name        : office-repo-latest           Relocations: / 

Version     : 6                                 Vendor: [email protected]

Release     : 1.el6                         Build Date: Thu 06 Aug 2015 04:53:26 PM CST

Install Date: (not installed)               Build Host: tvm-rpm

Group       : default                       Source RPM: office-repo-latest-6-1.el6.src.rpm

Size        : 2392                             License: unknown

Signature   : (none)

Packager    : PC

URL         : http://example.com/no-uri-given

Summary     : provide file: [local-office.repo] for local users. include: centos-base, eple, user-define rpms

Description :

provide file: [local-office.repo] for local users. include: centos-base, eple, user-define rpms

测试1:将打包的文件拷贝到其他主机上

[[email protected]test ~]# mv /etc/yum.repos.d/local-office.repo /tmp/

安装:

[[email protected]test ~]# rpm -ivh office-repo-latest-6-1.el6.x86_64.rpm 

Preparing...                ########################################### [100%]

   1:office-repo-latest     ########################################### [100%]

[[email protected]test ~]# diff /etc/yum.repos.d/local-office.repo /tmp/local-office.repo 

测试2:将打包的文件拷贝到本地的yum源来提供安装。

[[email protected] ~]# mv office-repo-latest-6-1.el6.x86_64.rpm /data/yum/repo/

先移除之前测试1安装的包:

[[email protected]test ~]# rpm -qa |grep office

office-repo-latest-6-1.el6.x86_64

[[email protected]test ~]# rpm -e office-repo-latest-6-1.el6.x86_64

安装:

[[email protected]test ~]# rpm -ivh http://mirrors.office.test/office-repo-latest-6-1.el6.x86_64.rpm

Retrieving http://mirrors.office.test/office-repo-latest-6-1.el6.x86_64.rpm

Preparing...                ########################################### [100%]

   1:office-repo-latest     ########################################### [100%]

[[email protected]test ~]# diff /etc/yum.repos.d/local-office.repo /tmp/local-office.repo    

【实例3:打包最新版的monit】

1)从官网下载最新的binary

[[email protected] rpms]# mkdir monit && cd monit

[[email protected] monit]# wget https://mmonit.com/monit/dist/binary/5.14/monit-5.14-linux-x64.tar.gz

[[email protected] monit]# tar zxvf monit-5.14-linux-x64.tar.gz 

monit-5.14/

monit-5.14/bin/

monit-5.14/bin/monit

monit-5.14/COPYING

monit-5.14/conf/

monit-5.14/conf/monitrc

monit-5.14/man/

monit-5.14/man/man1/

monit-5.14/man/man1/monit.1

[[email protected] monit]# cd monit-5.14

[[email protected] monit-5.14]# ll bin/ conf/ man/man1/

bin/:

total 2688

-rwxr-xr-x 1 root root 2752045 Jun  9 18:18 monit

conf/:

total 12

-rw------- 1 root root 11220 Jun  9 18:18 monitrc

man/man1/:

total 132

-rw-r--r-- 1 root root 131280 Jun  9 18:18 monit.1

拷贝到合适的位置:

[[email protected] monit-5.14]# cp -a bin/monit /usr/bin/  

[[email protected] monit-5.14]# cp -a conf/monitrc /etc/

[[email protected] monit-5.14]# cp -a man/man1/monit.1 /usr/share/man/man1/

增加一个控制脚本:

[[email protected] monit-5.14]# ll init.d/

total 4

-rwxr-xr-x 1 root root 1272 Jun  5  2014 monit

[[email protected] monit-5.14]# cp -a init.d/monit /etc/init.d/

创建目录:

[[email protected] monit-5.14]# mkdir /etc/monit.d

调整配置文件:

[[email protected] monit-5.14]# grep ^[^#] /etc/monitrc

set daemon  120

   with start delay 240 

set logfile /var/log/monit

include /etc/monit.d/*

2)打包

[[email protected] monit-5.14]# cd /data/rpms/pkgs/

[[email protected] pkgs]# fpm -s dir -t rpm \

    -a ‘x86_64‘ \

    -n ‘monit‘ \

    -v ‘5.14‘ \

    --iteration ‘1.el6‘ \

    --epoch ‘0‘ \

    --vendor ‘[email protected]‘ \

    --maintainer ‘PC‘ \

    --description ‘monit-5.14 for local users‘ \

    /usr/bin/monit \

    /etc/monitrc \

    /etc/monit.d \

    /usr/share/man/man1/monit.1 \

    /etc/init.d/monit

Created package {:path=>"monit-5.14-1.el6.x86_64.rpm"}

[[email protected] pkgs]# rpm -qpl monit-5.14-1.el6.x86_64.rpm 

/etc/init.d/monit

/etc/monit.d

/etc/monitrc

/usr/bin/monit

/usr/share/man/man1/monit.1

[[email protected] pkgs]# rpm -qpi monit-5.14-1.el6.x86_64.rpm  

Name        : monit                        Relocations: / 

Version     : 5.14                              Vendor: [email protected]

Release     : 1.el6                         Build Date: Fri 28 Aug 2015 06:00:57 PM CST

Install Date: (not installed)               Build Host: tvm-rpm

Group       : default                       Source RPM: monit-5.14-1.el6.src.rpm

Size        : 2895915                          License: unknown

Signature   : (none)

Packager    : PC

URL         : http://example.com/no-uri-given

Summary     : monit-5.14 for local users

Description :

monit-5.14 for local users

测试1:将打包的文件拷贝到其他主机上

[[email protected]test ~]# rpm -Uvh monit-5.14-1.el6.x86_64.rpm 

Preparing...                ########################################### [100%]

   1:monit                  ########################################### [100%]

[[email protected]test ~]# service monit start

Starting monit: Starting Monit 5.14 daemon

Monit start delay set -- pause for 240s

                                                           [  OK  ]

[[email protected]test ~]# chkconfig monit on

卸载:

[[email protected]test ~]# rpm -e monit-5.14-1.el6.x86_64

[[email protected]test ~]# ls /usr/bin/monit /etc/monitrc 

ls: cannot access /usr/bin/monit: No such file or directory

ls: cannot access /etc/monitrc: No such file or directory

可以发现,已经被删除。

测试2:更新到本地的yum源后安装

[[email protected] x86_64]# pwd

/data/yum/repo/office/6/x86_64

上传rpm包,重建repo:

[[email protected] x86_64]# createrepo .

Spawning worker 0 with 30 pkgs

Workers Finished

Gathering worker results

Saving Primary metadata

Saving file lists metadata

Saving other metadata

Generating sqlite DBs

Sqlite DBs complete

安装:

[[email protected]test ~]# yum makecache

[[email protected]test ~]# yum install monit

Loaded plugins: fastestmirror, security

Loading mirror speeds from cached hostfile

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package monit.x86_64 0:5.14-1.el6 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================

 Package                     Arch                         Version                           Repository                    Size

===============================================================================================================================

Installing:

 monit                       x86_64                       5.14-1.el6                        office                       1.2 M

Transaction Summary

===============================================================================================================================

Install       1 Package(s)

Total download size: 1.2 M

Installed size: 2.8 M

Is this ok [y/N]: y

Downloading Packages:

monit-5.14-1.el6.x86_64.rpm                                                                             | 1.2 MB     00:00     

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

  Installing : monit-5.14-1.el6.x86_64                                                                                     1/1

  Verifying  : monit-5.14-1.el6.x86_64                                                                                     1/1

Installed:

  monit.x86_64 0:5.14-1.el6                                                                                                    

Complete!

【实例4:打包tengine】

1、准备

mkdir /opt/fpm/{src,rpms,install} -p

export DIR_SRC_MAKE_INSTALL=/opt/fpm/install

export DIR_RPM_INSTALL=/opt/tengine

export DIR_RPMS=/opt/fpm/rpms

export DIR_FPM_SCRIPTS=/opt/fpm/scripts

2、源码编译

cd /opt/fpm/src

wget http://tengine.taobao.org/download/tengine-2.1.2.tar.gz

yum install pcre pcre-devel -y

tar zxvf tengine-2.1.2.tar.gz && cd tengine-2.1.2

./configure --prefix=${DIR_RPM_INSTALL}

===================================================注意以下输出,确认是否符合预期。

Configuration summary

  + using system PCRE library

  + using system OpenSSL library

  + md5: using OpenSSL library

  + sha1: using OpenSSL library

  + using system zlib library

  + jemalloc library is disabled

  nginx path prefix: "/opt/tengine"

  nginx binary file"/opt/tengine/sbin/nginx"

  nginx configuration prefix: "/opt/tengine/conf"

  nginx configuration file"/opt/tengine/conf/nginx.conf"

  nginx pid file"/opt/tengine/logs/nginx.pid"

  nginx error log file"/opt/tengine/logs/error.log"

  nginx http access log file"/opt/tengine/logs/access.log"

  nginx http client request body temporary files: "client_body_temp"

  nginx dso module path: "/opt/tengine/modules/"

  nginx http proxy temporary files: "proxy_temp"

  nginx http fastcgi temporary files: "fastcgi_temp"

  nginx http uwsgi temporary files: "uwsgi_temp"

  nginx http scgi temporary files: "scgi_temp"

===================================================

make && make install DESTDIR=${DIR_SRC_MAKE_INSTALL}

3、自定义配置文件和脚本

[[email protected] tengine-2.1.2]# cd /opt/fpm

1)编辑脚本,用于rpm包安装和卸载时执行指令:

[[email protected] fpm]# mkdir scripts

[[email protected] fpm]# cat scripts/after-install.sh 

#!/bin/bash

#

# 2017/2/22

# user

echo -e ‘\n\033[1;34mCreate user nginx:\033[0m\n‘

id nginx >/dev/null 2>&1 && echo ‘User [nginx] exist.‘ || (useradd -s /sbin/nologin -d /var/cache/nginx -c "nginx user" nginx;id nginx)

echo -e ‘\n\033[1;34mConfiguration summary:\033[0m\n‘

cat <<‘_EOF‘

===================================================

  + using system PCRE library

  + using system OpenSSL library

  + md5: using OpenSSL library

  + sha1: using OpenSSL library

  + using system zlib library

  + jemalloc library is disabled

  nginx path prefix: "/opt/tengine"

  nginx binary file"/opt/tengine/sbin/nginx"

  nginx configuration prefix: "/opt/tengine/conf"

  nginx configuration file"/opt/tengine/conf/nginx.conf"

  nginx pid file"/opt/tengine/logs/nginx.pid"

  nginx error log file"/opt/tengine/logs/error.log"

  nginx http access log file"/opt/tengine/logs/access.log"

  nginx http client request body temporary files: "client_body_temp"

  nginx dso module path: "/opt/tengine/modules/"

  nginx http proxy temporary files: "proxy_temp"

  nginx http fastcgi temporary files: "fastcgi_temp"

  nginx http uwsgi temporary files: "uwsgi_temp"

  nginx http scgi temporary files: "scgi_temp"

  startup script: /etc/init.d/tengine

===================================================

_EOF

echo -e ‘\n\033[1;33mTengine has been successfully installed.\033[0m\n‘

[[email protected] fpm]# cat scripts/before-remove.sh 

#!/bin/bash

#

# 2017/2/22

echo -e ‘\n\033[1;33mIn order to backup you data, please follow the guide, control it by hand.\033[0m\n‘

# service

echo -e ‘\n\033[1;34mService stopped.\033[0m\n‘

service tengine stop

# user

echo -e ‘\n\033[1;34m[Guide] Try to remove user nginx?\033[0m\n‘

echo ‘userdel -fr nginx‘

# dir

echo -e ‘\n\033[1;34mDirectory backuped: [/opt/tengine] -> [/opt/tengine.old]\033[0m\n‘

mv -fv /opt/tengine /opt/tengine.old

2)控制脚本

[[email protected] fpm]# mkdir install/etc/init.d

[[email protected] fpm]# vim install/etc/init.d/tengine

(略)

[[email protected] fpm]# chmod +x install/etc/init.d/tengine

4、开始打包

[[email protected] fpm]# fpm -s dir -t rpm \

    -n Tengine \

    -v ‘2.1.2‘ \

    --iteration ‘1.el6‘ \

    --epoch ‘0‘ \

    --vendor ‘[email protected]‘ \

    --maintainer ‘PC‘ \

    --description ‘Tengine is based on Nginx which stands for Engine-X.‘ \

    --url ‘tengine.taobao.org‘ \

    -C ${DIR_SRC_MAKE_INSTALL} \

    -p ${DIR_RPMS} \

    -d ‘pcre‘ \

    --after-install ${DIR_FPM_SCRIPTS}/after-install.sh \

    --before-remove ${DIR_FPM_SCRIPTS}/before-remove.sh \

    -f

    

Created package {:path=>"/opt/fpm/rpms/Tengine-2.1.2-1.el6.x86_64.rpm"}   

    

    

5、查看rpm包内的文件:

[[email protected] fpm]# rpm -qpl /opt/fpm/rpms/Tengine-2.1.2-1.el6.x86_64.rpm  

[[email protected] fpm]# tree -L 2

.

├── install     -> fpm打包时,将chroot到这个目录,对应安装后的文件系统中以下路径:/opt/etc

│   ├── etc         -> 在nginx的安装包中拷贝/etc/init.d/nginx,改一下配置文件中的相关路径为tengine的即可,然后将文件拷贝到这里(/etc/init.d/tengine)即可。

│   └── opt         -> 源码安装后的目录

├── rpms

│   └── Tengine-2.1.2-1.el6.x86_64.rpm      -> rpm包保存在这里

├── scripts

│   ├── after-install.sh                    -> 安装rpm包后执行这个脚本

│   └── before-remove.sh                    -> 卸载rpm包前执行这个脚本

└── src

    ├── tengine-2.1.2                       -> 源码编译的工作目录

    └── tengine-2.1.2.tar.gz                -> 源码

7 directories, 4 files

6、拷贝rpm包到一台新的机器上测试:

符合预期。

    

    

    

    

    

    

ZYXW、参考

1、fpm/wiki

https://github.com/jordansissel/fpm/wiki

2、使用 FPM 创建 Python 的 RPM 包

http://theo.im/blog/2014/05/16/use-fpm-to-create-python-rpm-packages/

3、使用FPM快速生成RPM包

https://linux.cn/article-3184-1.html

参考==>

http://nosmoking.blog.51cto.com/3263888/1675009

http://www.cnblogs.com/saneri/p/5265661.html

时间: 2024-08-27 20:09:28

001_fpm打包命令详解的相关文章

转 vagrant package[打包命令]详解

转 vagrant package[打包命令]详解 vagrant的一个非常重要的功能就是在你的同事之间分享你的box从而使大家的开发环境保持同步,打包[package]正是实现这一功能的关键所在. (写到这里我想到vagrant是否提供一种通过配置中心主机实现对其他虚拟主机进行软件更新的作用,这样就不用重新打包了,或者这是puppt的业务所在?) vagrant package的命令很简单,不过有些地方官方文档并没有说清楚,我在这里补充一下 vagrant package -hUsage: v

jar打包命令详解

:如何把 java 程序编译成 .exe 文件.通常回答只有两种,一种是说,制作一个可执行的 JAR 文件包,就可以像.chm 文档一样双击运行了:而另一种回答,则是使用 JET 来进行编译.但是 JET 是要用钱买的,而且,据说 JET 也不是能把所有的 Java 程序都编译成执行文件,性能也要打些折扣.所以,使用制作可执行 JAR 文件包的方法就是最佳选择了,何况它还能保持 Java 的跨平台特性.先来看看什么是 JAR 文件包: 1. JAR 文件包 JAR 文件就是 Java Archi

jar 打包命令详解

引自:http://blog.csdn.net/marryshi/article/details/50751764 本文详细讲述了JAR命令的用法,对于大家学习和总结jar命令的使用有一定的帮助作用.具体如下: JAR包是Java中所特有一种压缩文档,其实大家就可以把它理解为.zip包.当然也是有区别的,JAR包中有一个META-INF\MANIFEST.MF文件,当你找成JAR包时,它会自动生成. JAR包是由JDK安装目录\bin\jar.exe命令生成的,当我们安装好JDK,设置好path

ant的高级使用,ant命令详解,ant打包,ant编译后打包去掉jar文件

在日常的项目开发中,我们可以经常性的需要打包测试,尤其是开发环境是windows,而实际环境则是linux. 这样的话,很多程序员要一会打一个包,一会打一个包,这些包可能会很大,实际上只有代码部分会变动,而jar包基本则不动. 当然很多人可能会说,自动化测试.很好的,我们今天要做的就是自动化测试的第一步. 这个时候我是可以使用ant来打包,去掉项目中的所有的jar文件.然后在项目的tomcat启动时到特定的地点去加载jar文件. 这样做,war包可能会只有几M,什么更小.具体如何动态的加载jar

压缩/打包/解包 命令详解

压缩&解压 gzip gzip 压缩级别1-9 1 压缩级别最低 9压缩级别最高 [默认级别6] 压缩文件类型.gz 压缩:gzip 压缩文件名 [修改压缩级别方法:gzip -1 压缩文件名称] 解压:gzip -d 解压文件名称/gunzip 解压文件名 查看压缩文件:zcat压缩文件名 gzip 只支持文件,不支持目录 bzip2 压缩文件类型.bz2 [也是无法压缩目录.只能压缩文件] 压缩:bzip2 文件名称 解压:bzip2 -d 文件名称/bunzip2 文件名 查看压缩文件:b

Linux压缩与解压缩命令详解

简介:常用的压缩命令有gzip.bzip2.tar 提示:gzip与bzip2工具不可以对目录做打包压缩操作,gzip与bzip2解压都是用-d参数(decompress=uncompress) tar命令详解: 用法:tar 模式 [选项][路径]... 模式:    -c 创建打包文件 -delete -r --append -t --list内容 -x --extract 选项:    -C --directory -f 打包后的文件名称 -j bzip格式压缩 --remove-file

[转] - JAR文件包及jar命令详解 ( MANIFEST.MF的用法 )

常常在网上看到有人询问:如何把 java 程序编译成 .exe 文件.通常回答只有两种,一种是制作一个可执行的 JAR 文件包,然后就可以像. chm 文档一样双击运行了:而另一种是使用 JET 来进行 编译.但是 JET 是要用钱买的,而且据说 JET 也不是能把所有的 Java 程序 都编译成执行文件,性能也要打些折扣.所以,使用制作可执行 JAR 文件包的方法就是最佳选择了,何况它还能保持 Java 的跨平台特性. 下面就来看看什么是 JAR 文件包吧: 1. JAR 文件包 JAR 文件

tar命令详解

tar命令详解 -c: 建立压缩档案 -x:解压 -t:查看内容 -r:向压缩归档文件末尾追加文件 -u:更新原压缩包中的文件 这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用其中一个. 下面的参数是根据需要在压缩或解压档案时可选的. -z:有gzip属性的 -j:有bz2属性的 -Z:有compress属性的 -v:显示所有过程 -O:将文件解开到标准输出 参数-f是必须的 -f: 使用档案名字,切记,这个参数是最后一个参数,后面只能接档案名. # tar -cf al

赵雅智_android使用adb命令详解附图

adb是一个客户端-服务器端程序,其中客户端是你用来操作的电脑,服务器端是android设备 我们除了用可视化窗口中操作也可以采用cmd命令行进行操作. 在开始菜单的搜索栏中输入cmd打开命令行 在本地找到adb.exe路径(如图1.1),把adb.exe拖到cmd命令行敲击回车显示所有可操作帮助示例(如图1.2). 图1.1 adb.exe路径 图1.2 adb命令示例 如果不输入adb的正确路径就不能进行正常显示,如图1.3: 图1.3adb未能正确打开 为了保证adb在任何路径下都能使用,