명령어/Linux

[RHEL] rpmdev-bumpspec spec 버전 올리고 changelog 추가

jykim23 2026. 7. 16. 17:42
반응형

부제: 릴리스 번호와 changelog를 한 번에 올린다

rpmdev-bumpspec hello.spec                 # Release 1 → 2, changelog 추가
rpmdev-bumpspec -c "버그 수정" hello.spec  # changelog 메시지 지정
rpmdev-bumpspec -n 3.0 hello.spec          # 새 Version 지정
$ rpmdev-bumpspec -c "Rebuild for updated toolchain" hello.spec
$ grep ^Release hello.spec
Release:        2%{?dist}
$ sed -n '/%changelog/,+3p' hello.spec
%changelog
* Wed Jul 15 2026 root - 2.12-2
- Rebuild for updated toolchain

rpmdev-bumpspec는 릴리스 번호를 하나 올리고, 오늘 날짜와 패키저 이름으로 changelog 항목을 맨 위에 끼워준다. 손으로 고치면 날짜 요일이 틀리거나 형식이 어긋나기 쉬운데, 이 도구가 규격을 맞춰준다. 대량 리빌드 때 여러 spec의 버전을 일괄로 올리는 데 특히 유용하다.

이렇게도 쓴다

버전 자체를 새 값으로 올린다.

rpmdev-bumpspec -n 3.0.0 -c "Update to 3.0.0" hello.spec

 

패키저 이름을 명시해 changelog에 박는다.

rpmdev-bumpspec -u "Max <max@example.com>" -c "Rebuild" hello.spec

 

디렉토리의 모든 spec을 한 번에 올린다.

rpmdev-bumpspec -c "Mass rebuild" *.spec

 

find로 찾은 spec 전부에 적용한다.

find ~/rpmbuild/SPECS -name '*.spec' -exec rpmdev-bumpspec -c "Rebuild" {} +

 

올린 뒤 바뀐 NVR을 rpmspec으로 확인한다.

rpmdev-bumpspec hello.spec && rpmspec -q --srpm hello.spec
반응형